I have a select tag as follows
<SELECT ID="Select1" NAME="Select1" ONCHANGE="do_al ert()">
<OPTION>1</OPTION>
<OPTION>2</OPTION>
</SELECT>
I need, when the user choose an option, to print an alert
which displays the text in the option chosen, i.e. 1 or 2
in this example, but how do I access the value of the html
select tag, I tried
alert(document. getElementById( 'Select1').valu e);
But this seems to be an empty alert box. Any ideas what might I be
doing wrong?
Tia
<SELECT ID="Select1" NAME="Select1" ONCHANGE="do_al ert()">
<OPTION>1</OPTION>
<OPTION>2</OPTION>
</SELECT>
I need, when the user choose an option, to print an alert
which displays the text in the option chosen, i.e. 1 or 2
in this example, but how do I access the value of the html
select tag, I tried
alert(document. getElementById( 'Select1').valu e);
But this seems to be an empty alert box. Any ideas what might I be
doing wrong?
Tia
Comment