Please look at the following code.
var $myInput = $('#myInput'); //select the <input> element
$myInput.on('focus', function(){
console.log('Input focused');
})
Now if I execute the following two lines in IE:
$myInput.trigger('focus');
console.log('Done');
.. the output will be :
Done
Input Focused
This is because, in IE, the triggered events execute asynchronously. But it's the other way around in all the other browsers. Is there any workaround than using the triggerHandle()
or manually calling the event handler function?