'options' Example : options « Javascript Collections « JavaScript DHTML






'options' Example

    
<html>
<body>
<select id="mySelect">
    <option>List Item 1</option>
    <option>List Item 2</option>
    <option>List Item 3</option>
    <option>List Item 4</option>
    <option>List Item 5</option>
    <option>List Item 6</option>
</select>
<button onclick="alert(mySelect.options.length);">
Number of options in the select list
</button>
</body>
</html>

    
      
      








Related examples in the same category