html wrote:
I have a select tag as follows
<SELECT ID="Select1" NAME="Select1" ONCHANGE="do_alert()">
<OPTION>1</OPTION>
<OPTION>2</OPTION>
</SELECT>
HTML-wise (i.e., from the perspective we are supposed to have in this
group), that construct has more problems than I care to list down. This is
probably not your _real_ select element, is it?
I need, when the user choose an option, to print an alert
which displays the text in the option chosen,
That's external to HTML, of course, hence off-topic in this group. Your use
of the fake name "html" does not change that.
but how do I access the value of the html
select tag, I tried
alert(document.getElementById('Select1').value);
We could tell you, but that would be off-topic and would teach you wrong
habits, like posting to a wrong group and not reading the fine manual. So
consider reading a tutorial on the basics of an introduction to the elements
of JavaScript in the web context before trying to use JavaScript on the web.
--
Yucca,
http://www.cs.tut.fi/~jkorpela/