Number of options in the dropdown list(Combobox) : Option Select ComboBox : Form Control JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Form Control » Option Select ComboBox »

 

Number of options in the dropdown list(Combobox)




<html>
<head>
<script type="text/javascript">
function formAction(){
    var x=document.getElementById("mySelect")
    alert(x.length)
}
</script>
</head>

<body>
<form>
<select id="mySelect">
  <option>1</option>
  <option>2</option>
  <option>3</option>
</select>
<input type="button" onclick="formAction()" value="How many options in the list?">
</form>
</body>
</html>



           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Form Control
» Option Select ComboBox