I am new to javascript and have the following problem:
In HTML I have multiple select elements with the same list of options. (In this example 2.)
How can I make it that if you select 'Option 1' in the first select you can not select 'Option 1' in the second select element.
Also when you then select 'Option 2' in the first select you should be again possible to select
'Option 1' in the second but not 'Option 2'.
This is how the html looks:
<select id="1">
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
<option value="4">Option 4</option>
</select>
<select id="2">
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
<option value="4">Option 4</option>
</select>
This is what I found for the js: Removing an item from a select box
I tried to use it to solve my problem but it didn't work.
Can you help me? I'm sorry if this is very simple.