Devi
Devi

Reputation: 55

select option hover is not working in IE

I wrote a little code to get some tooltips in my multiple select box, The code is working file in FF but not in IE :(

ex:

$('#select > option').mouseover(function(){
  alert($(this).text());
});

Can anyone help me?

Upvotes: 2

Views: 8522

Answers (2)

Andy E
Andy E

Reputation: 344537

onmouseover will not fire for option elements in Internet Explorer. In fact, no mouse or keyboard events fire for option elements. See the msdn documentation for the events available:

http://msdn.microsoft.com/en-us/library/ms535877(VS.85).aspx

EDIT - The same is true of Google Chrome (and most likely Safari too).

Upvotes: 9

Pekka
Pekka

Reputation: 449395

Edit: I can't guarantee that it makes hover work for options, but try whatever:hover:

Whatever:hover is a small script that automatically patches :hover, :active and :focus for IE6, IE7 and IE8 quirks, letting you use them like you would in any other browser. Version 3 introduces ajax support, meaning that any html that gets inserted into the document via javascript will also trigger :hover, :active and :focus styles in IE.

Upvotes: 0

Related Questions