I have a 2 select dropdowns each of them have bunch of elements (just an example below).
<select id="one">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
</select>
<select id="two">>
<option>2</option>
<option>4</option>
<option>6</option>
<option>8</option>
</select>
How do I ide some options in second dropdown when the first dropdown element is selected. (for example, if 1 is selected in dropdown #1, then 1+2=2 option should be hidden in dropdown #2, if 2 is seected in #1, then 2+2=(4) should be hidden in #2. etc.
I guess I need to approach it with something like this:
document.getElementById("one").onchange = function( ){
var selectedOption = document.getElementById("one").options[document.getElementById("one").selectedIndex].text;
}
What should I do next?