I\'ve got a little issue with the focus event that I just became aware of. Apparently, focus fires when switching to another browser tab and then back again. I\'d rather not hav
Try this to get around the problem:
var times = 0, foc=true; $(window).on('focus', function() { foc = false; setTimeout(function() {foc=true}, 200); }); $('input').on('focus', function() { if (foc || times===0) { times ++; $(this).after('Focused '+times+' times'); } });
FIDDLE