0

I have the following code. However, the event is triggered when both mouse entering selector and selector is given focus via Tab.

$("selector").mouseenter(function(){

     $(this).addClass("red");

})

I would like to an event can be only triggered by mouse, without being able to Tab to it.

Ryan B
  • 3,364
  • 21
  • 35
Acubi
  • 2,793
  • 11
  • 41
  • 54
  • You can ignore it from tabindex if that helps. http://stackoverflow.com/questions/5192859/html-remove-element-from-tab-index – Ihor Deyneka May 21 '13 at 13:48
  • Can you explain why you want to do this and give more code? `mouseEnter()` only fires when you use the mouse, not the Tab, per [this question](http://stackoverflow.com/questions/7916754/jquery-mouseenter-works-great-with-mouse-but-not-with-tab-key), so you are firing it on something like an anchor or has a `tabindex="0"`. People who follow this tag often work for make the web more accessible, so this may be seen as the opposite. – Ryan B May 21 '13 at 14:52

0 Answers0