August 1999
Intermediate to advanced
1488 pages
72h 53m
English
option.selected
The selected property of the Option object specifies the current selected option of the select list.
Listing 7.410 shows an example of how the selected property is used. The check function checks to see what the selected property is.
<html> <head> <title> Example of the selected property of the option object</title> </head> <body> <script language="JavaScript"> <!--Hide // function checks the forms to see what the selected property is function check(myForm){ for (var i = 0; i < document.form1.myList.length; i++) { if (document.form1.myList.options[i].selected == true) { alert("The selected value is: " + document.form1.myList.options[i].value); ... |
Read now
Unlock full access