Hellloooooo ... I have two inputs <select>
like
<select id="sel1">
<option value="a">a</option>
<option value="b">b</option>
</select>
<select id="sel2">
//if 'a' is selected above,
//<option>apple</option>, <option>airplane</option>
//if 'b' is selected above,
//<option>banana</option>, <option>book</option>
</select>
And I want to list different sets of parameters according to the selection in sel1
. I could get the selected value using the onchange attribute like this:
<select id="sel1" onchange="giveSelection(this)">
<script type="text/javascript">
function giveSelection(sel) {
var selected = sel.value;
}
</script>
But I can't think of a way to use this value to display various select options in sel2
. Help me please!
html
html-select
forms
Yun c han
source
to share