Method 1:
<Form name = form1>
<Select name = "test" id = "test">
<Option
Value = "Tes
Tvalue "Selected> required content </option>
</SELECT>
</Form>
<Script language = JavaScript>
Alert (form1.test. Options [form1.test. selectedindex]. Text );
</SCRIPT>
Method 2:
<Form name = form1>
<Select name = "test" id = "test">
<OptionValue= "TesTvalue"Selected> required content </option>
</SELECT>
</Form>
<Script language = JavaScript>
With (document. getelementsbytagname ("select") [0]) {
Alert (options [selectedindex]. Text );
}
</SCRIPT>
Method 3:
<Select onchange = "window. Alert (options [selectedindex]. innertext);">
<OptionValue= "1"> -- 1 -- </option>
<OptionValue= "2"> -- 2 -- </option>
<OptionValue= "3"> -- 3 -- </option>
</SELECT>
Method 4:
<Body> <select name = "test">
<OptionValue= "001"> 1 </option>
<OptionValue= "002"> second </option>
<OptionValue= "003"> third </option>
<OptionValue= "004"> fourth </option>
</SELECT>
<Input type = buttonValue= "Show"Onclick= "Show ()">
<SCRIPT>
Function show (){
VaR isstr = "";
For (VAR I = 0; I <document. All. Test. Options. length; I ++)
Isstr + = Document. All. Test. Options. Innertext + "\ n ";
Alert (isstr );
}
</SCRIPT>
Method 5:
value = "001"> first value = "002"> second value = "003 "> third value =" 004 "> fourth
value = "show" onclick = "alert (document. all. test. options. innertext) ">