We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$.fn.extend({ placeholder:function () { if ("placeholder" in document.createElement("input")) { return this //如果原生支持placeholder属性,则返回对象本身 } else { return this.each(function () { var _this = $(this); if(_this.attr('type')!='password'){ _this.val(_this.attr("placeholder")).focus(function () { if (_this.val() === _this.attr("placeholder")) { _this.val("") } }).blur(function () { if (_this.val().length === 0) { _this.val(_this.attr("placeholder")) } }); }else{ var newObj=$('<input type="text" value="'+_this.attr('placeholder')+'" autocomplete="off" class="'+_this[0].className+'" />'); _this.hide().after(newObj); newObj.focus(function(){ newObj.hide(); _this.show().focus(); }); _this.blur(function(){ if(_this.val() == '') { newObj.show(); _this.hide(); } }); } }) } } });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: