'index' Example : Option Select ComboBox : Form Control JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Form Control » Option Select ComboBox »

 

'index' Example



    
<html>
<body>
<select id="mySelect" size=5>
   <option id="o1">1</option>
   <option id="o2">2</option>
   <option id="o3">3</option>
   <option id="o4">4</option>
   <option id="o5">5</option>
</select>
<input type="button" value="1" onClick="function1(o1);">
<input type="button" value="2" onClick="function1(o2);">
<input type="button" value="3" onClick="function1(o3);">
<input type="button" value="4" onClick="function1(o4);">
<input type="button" value="5" onClick="function1(o5);">
<script language="JavaScript">
    function function1(elem) {
        alert("Index: "+ elem.index);
    }
</script>
</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