View

onClick event on

  1. Remove the events from the options, use an event directly on the select instead.
  2. function myfunc(value) {
  3.   alert(value);
  4. }
  5. <select onchange=“myfunc(this.options[this.selectedIndex].value)”>
  6.   <option value=“1”>Item1</option>
  7.   <option  value=“2”>Item2</option>
  8. </select>

You may also like