if( !('placeholder'indocument.createElement('input')) ){
$('input[placeholder],textarea[placeholder]').each(function(){varthat = $(this),
text= that.attr('placeholder');//console.log(text);if(that.val()===""){
that.val(text).addClass('placeholder');
}
that.focus(function(){if(that.val()===text){
that.val("").removeClass('placeholder');
}
}).blur(function(){if(that.val()===""){
that.val(text).addClass('placeholder');
}
}).closest('form').submit(function(){if(that.val() ===text){
that.val('');
}
});
});
}
网友评论