jQuery blur() or focusout() not firing in Internet Explorer
So i have this form and i would like to do some stuff when the inputs
loose focus. This is the code i have and it's working like a champ in
every browser except Internet Explorer.
function formstyle() {
var focus = 0;
//comentario is the ID of the input
$("#comentario").focus(function() {
//blablablabla
});
$("#comentario").blur(function() {
setTimeout(function() {
var whatFocus = document.activeElement.tagName;
if(whatFocus === "BODY")
{
focus = 0;
//bla bla bla
}
}, 2);
});
}
$(document).ready(function(){
formstyle();
});
I'm almost blowing up my mind. It's a simple piece of code and yet…
nothing… Did i miss anything?
No comments:
Post a Comment