The common properties of the DOM access list box, drop-down menu are as follows:
Form |
Returns the Form object containing the list box, drop-down menu |
Length |
Returns the number of options for the list box, drop-down menu |
Options |
Returns an array of all the options in the list box, drop-down menu |
SelectedIndex |
Returns the index of the selected item in the drop-down list |
Type |
Returns the type of the drop-down list, returning select-multiplewith multiple choices, and returning the radio Select-one |
B. use Options[index] to return the properties that are used for the specific option:
defaultselected |
Returns whether the option is selected by default |
Index |
Returns the index of this option in the list box, drop-down menu |
Selected |
Returns whether this option is selected |
Text |
Returns the text that the option renders |
Value |
Returns the value of this option |
<!doctype html>varC=document.getelementbyid (' sel '); functionDan (curr) {alert (curr.text); }</script></body>JS Basic 12-dom access list box, drop-down menu Common Properties