I am working with two HTML select elements. Below is an example of the code:
<select class="select1" onchange='customJavascriptfuntion()'>
<option value='a'>a</option>
<option value='b'>b</option>
<option value='c'>c</option>
</select>
<select class="select2">
<option value='d'>d</option>
<option value='e'>e</option>
<option value='f'>f</option>
<option value='g'>g</option>
<option value='h'>h</option>
<option value='i'>i</option>
<option value='j'>j</option>
</select>
Currently, I am looking for a JavaScript function that will dynamically change the options in the second select based on the option selected in the first select. For instance, if "b" is selected in the first select, then the options in the second select should be "g,h,i,j". If "c" is selected, then the options should be "d,e,f", and if "a" is selected, then all options should be shown.