Remove an option from a dropdown list (combobox) : Option Select ComboBox : Form Control JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Form Control » Option Select ComboBox »

 

Remove an option from a dropdown list (combobox)




<html>
<head>
<script type="text/javascript">
function formAction(){
    var x=document.getElementById("aSelectControl")
    x.remove(x.selectedIndex)
}
</script>
</head>

<body>
<form>
<select id="aSelectControl">
  <option>Java</option>
  <option>PHP</option>
  <option>Perl</option>
</select>
<input type="button" onclick="formAction()" value="Remove option">
</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