August 1999
Intermediate to advanced
1488 pages
72h 53m
English
select.length
The length property of an instance of a Select object returns the number of items in the select box.
Listing 7.468 has a single select box and button. The length property of a Select object is displayed in an alert box when the button is clicked.
<html> <head> <script language="JavaScript"> <!-- Hide // Display an alert box that contains the length of the // select box. function getName(){ alert("The length of this select box is " + document.myForm.mySelect.length); } // End hide ---> </script> </head> <body> <form name="myForm"> <select name="mySelect"> ... |
Read now
Unlock full access