'index' Example : index « Javascript Properties « JavaScript Reference

Home
JavaScript Reference
1.Event Handlers Reference
2.Javascript Collections
3.Javascript Methods
4.Javascript Objects
5.Javascript Properties
JavaScript Reference » Javascript Properties » index 




'index' Example

    
<html>
<body>
<select id="myS" 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>

    
      
      














Related examples in the same category
1.'index' Syntax and Note
2.'index' is applied to
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.