I'm encountering difficulties while attempting to develop the code for this specific task. My goal is to display or hide divs based on the selection made in a select option, with a total of 4 options available.
There are 2 select elements
<select>
<option value="value1">Value 1</option>
<option value="value2">Value 2</option>
</select>
<select>
<option value="value3">Value 3</option>
<option value="value4">Value 4</option>
</select>
The possible combinations are:
value1-value3 value1-value4
value2-value3 value2-value4
The second select element remains empty until an option is picked from the first select element. Once selected, the second select element becomes active and displays the corresponding div for that particular value.
The divs would be:
<div id="value-1-3">value1-value3</div>
<div id="value-1-4">value1-value4</div>
<div id="value-2-3">value2-value3</div>
<div id="value-2-4">value2-value4</div>
Would appreciate any assistance you could provide in accomplishing this task.