let selected_topic = document.getElementById("topic-selection") let subtopic_selection_div = document.getElementById("subtopic-selection-div") let subtopic_selection_div_text = subtopic_selection_div.innerHTML let subtopics = [ ["any"], ["any","basic_algebra","combine_like_terms","complex_quadratic","compound_interest","distance_two_points","expanding","factoring","intersection_of_two_lines","invert_matrix","linear_equations","line_equation_from_2_points","log","matrix_multiplication","midpoint_of_two_points","multiply_complex_numbers","quadratic_equation","simple_interest","system_of_equations","vector_cross","vector_dot","orthogonal_projection"], ["any","absolute_difference","addition","compare_fractions","cube_root","divide_fractions","division","exponentiation","factorial","fraction_multiplication","fraction_to_decimal","greatest_common_division","is_composite","is_prime","multiplication","percentage","percentage_difference","percentage_error","power_of_powers","square","square_root","simplify_square_root","subtraction"], ["any","definite_integral","power_rule_differentiation","power_rule_integration","stationary_points","trig_differentiation"], ["any","bcd_to_decimal","binary_2s_complement","binary_complement_1s","binary_to_decimal","binary_to_hex","decimal_to_bcd","decimal_to_binary","decimal_to_hexadeci","decimal_to_octal","fibonacci_series","modulo_division","nth_fibonacci_number"], ["any","angle_btw_vectors","angle_regular_polygon","arc_length"], ["any","arithmatic_progression_sum","arithmatic_progression_term","base_conversion"], ["any","combinations","conditional_probability"]] function onChange() { let value = selected_topic.value; let text = selected_topic.options[selected_topic.selectedIndex].text; value = Number(value) console.log(value); let selection_text = "" subtopic_selection_div.innerHTML = selection_text; } selected_topic.onchange = onChange; onChange();