Here is the select block:
<form>
<select id="select">
<option disabled selected value="choose">
CHOOSE
</option>
<option value="i2g" id="i2g">
iPhone 2g
</option>
<option value="i3g" id="i3g">
iPhone 3g
</option>
</select>
<button onclick="func1()" type="button">
GO
</button>
</form>
Here is the table content:
<table id="iphone1g" border="1">
<tr>
<td id="itable1">
1
</td>
<td id="itable2">
2
</td>
</tr>
</table>
Here's the javascript:
<script>
var x = document.getElementById("i2g")
var y = document.getElementById("i3g")
var m = document.getElementById("itable1")
var n = document.getElementById("itable2")
function func1(){
if (x.selected = "true"){
m.innerHTML = "hello"
}
if (y.selected = "true"){
m.innerHTML = "adele"
}
}
</script>
It doesn't work. I can choose only one option of the whole select and it can be only the last one.