First of all, Both select tags must have unique ids. In question, you are using same id "cars". which won't work. So say for example, second select tag has id "cars2".
In that case, you can disable option chosen in first select tag from second select tag as below:
dropdown selection elimination
in JavaScript
Posted
First of all, Both select tags must have unique ids. In question, you are using same id "cars". which won't work. So say for example, second select tag has id "cars2".
In that case, you can disable option chosen in first select tag from second select tag as below:
You should not remove option from select tag, as we can't get it back once removed. So we are using disable method.