[英]why the Placeholderdo not work in IE8?
好的,我们采用jquery.placeholder.js
我们可以看到第57行
// IE < 9 doesn't allow changing the type of password inputs
if ($.browser.msie && input[0].outerHTML) {
var fakeHTML = $(input[0].outerHTML.replace(/type=(['"])?password\1/gi, 'type=$1text$1'));
this.fakePassword = fakeHTML.val(input.attr('placeholder')).addClass('placeholder').focus(function() {
input.trigger('focus');
$(this).hide();
input.show(); //add this code
});
$(input[0].form).submit(function() {
fakeHTML.remove();
input.show()
});
}
添加代码“input.show();” ,你可以让输入不隐藏在IE8中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.