I
I
impressive172020-04-18 17:51:19
JavaScript
impressive17, 2020-04-18 17:51:19

How to change the available options in one dropdown list depending on the selection made in another in JS?

How to change the available options in one dropdown list depending on the selection made in another in JS?
That is, so that, for example, only one drop-down list was initially visible. After selecting a certain option in it, a second drop-down list appeared, the available options in which depend on which option I selected in the first drop-down list
. If you change the choice in the first drop-down list, the selected option in the second drop-down list should reset. And in the second drop-down list, other options should become available for selection.
For example, there are two drop-down lists to select a category and subcategory of a product.
If I select the category "Cars" in the first drop-down list, then in the second I am given car brands for selection, and if I select Electronics in the first drop-down list, then the names of electronics manufacturers will already be available for selection in the second.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question