View: onClick event on

  1. 11 years ago by spirit
    1. Remove the events from the options, use an event directly on the select instead.
    2.  
    3. function myfunc(value) {
    4.   alert(value);
    5. }
    6. ...
    7. <select onchange="myfunc(this.options[this.selectedIndex].value)">
    8.   <option value="1">Item1</option>
    9.   <option  value="2">Item2</option>
    10. </select>
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/761"></script>

0 comment about "onClick event on <option> does not fire in Internet Explorer"