Focusout and .live
Focusout and .live
I'm trying to use .live to assign handlers to my inputs' focusin and focusout events using the code below:
- jQuery("input.msg").live("focusin focusout", function(event) {
var me = jQuery(this);
if (event.type == "focusin") {
me.data("orig",me.val()).removeClass("msg").val("");
} else {
if (me.val() == "") me.addClass("msg").val(me.data("orig"));
}
});
Focusout never fires. If I use .bind, it works. I use Ajax to add input fields though, so .live would be much better to have.
Any ideas on why it's not firing?