Suppose I do this:
$(target).blur(function(e){
//do stuff
});
Is there a way to fetch the object that was clicked on in order to trigger the blur action?
I tried using e.target
, but that appears to be returning the object attached to the blur action rather than the clicked object.
The trick is to wait an extra tick:
$(el).blur(function (event) {
// If we just hangout an extra tick, we'll find out which element got focus really
setTimeout(function(){
document.activeElement; // This is the element that has focus
},1);
})