I have the following Javascript code:
<script>
function slboxchg()
{
if(document.getElementById("slbox").value != 0)
{
var x = 'a'+document.getElementById("slbox").value;
alert(x);
}
}
</script>
<script>
var a1 = "1,2,3";
var a2 = "3,4,5";
</script>
<select id='slbox' onchange='slboxchg()'>
<option value='0'>None</option>
<option value='1'>Apple</option>
<option value='2'>Banana</option>
</select>
When I select "Apple", I expected the alert box show "1,2,3", but it showed "a1" instead.
Thank you for your time.