Options in select
<script> function function1() { var col = document.all.colors.size; alert(col+" number of options") } </script> <form method="post" action=""> <select id="colors" size="10"> <option value="white" selected>White</option> <option value="cyan">Cyan</option> <option value="ivory">Ivory</option> <option value="blue">Blue</option> <option value="red">Red</option> <option value="lightblue">Lightblue</option> <option value="beige">Beige</option> </select> <input type="button" value="Number of options" onclick="function1();"> </form>