0

I would like to know how to generate an event as an item on a drop down list is highlighted with the mouse. Here is the code as an example:

<select>
  <option value="A">A</option>
  <option value="B">B</option>
  <option value="C">C</option>
  <option value="D">D</option>
</select>

I tried the following without much luck...

<select>
  <option onmouseover="myfunction()" value="A">A</option>
  <option onmouseover="myfunctionTwo()" value="B">B</option>
  <option onmouseover="myfunctionThree()" value="C">C</option>
  <option onmouseover="myfunctionFour()" value="D>D</option>
</select>

I am new to HTML so please be gentle with your suggestions. I just came across this challenge as I am preparing myself for something big.

Thanks.

Maxim Pontyushenko
  • 2,983
  • 2
  • 25
  • 36
  • 1
    I believe this is more difficult than it might initially seem. I think your best solution might be to build something that behaves like a select box using
  • or
    elements and mouseOver those instead. See http://stackoverflow.com/questions/12284510/detect-mouseover-of-select-option-in-all-browsers
  • – Kez Jul 16 '15 at 12:06
  • Thanks a lot. I need to go back to my drawing desk and see how I can make this work for me. I will still like to know if there are other options available. cheers – Jeffrey Vera Jul 17 '15 at 10:42