JavaScript Reference/Javascript Properties/size select
"size" Example
<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>
"size" is applied to
+----------------+--------------------------------------------------------------+
| Applied_To |<select> |
+----------------+--------------------------------------------------------------+
"size" Syntax and Note
Note:
Read and write property.
Sets the number of rows in <select> list element.
Syntax:
document.getElementById("selectID").size = value
document.all.selectID.size = value // IE only