0

I was struggling with an IE issue to overcome an input cursor remains visible when behind a div with z-index. I found a answer here link, but wanted to convert it into jquery code.

JavaScript Core:

document.querySelector('.main-nav').addEventListener('mouseenter', function(){
  document.activeElement.blur();
});

JQuery: What I try...

$('body').on('mouseenter', '.main-nav', function() {
     document.activeElement.blur();
});

when I run this line on IE console getting following error. I'm not sure about it. Please help me to convert it.

The object doesn't support property or method 'on'

Vikrant
  • 4,920
  • 17
  • 48
  • 72
Daniel Smith
  • 1,626
  • 3
  • 29
  • 59

1 Answers1

0

You can try the variant in jQuery:

$( ".main-nav" ).mouseenter(function() {
  $(':focus').blur();
});
Elena Lembersky
  • 766
  • 4
  • 3