Javascript 为什么占位符在IE8中不起作用?
当我输入“密码”时,它会隐藏占位符和输入 好的,我们走 我们可以看到第57行Javascript 为什么占位符在IE8中不起作用?,javascript,jquery,html,jquery-plugins,Javascript,Jquery,Html,Jquery Plugins,当我输入“密码”时,它会隐藏占位符和输入 好的,我们走 我们可以看到第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
// 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()
});
}
//IE<9不允许更改密码输入的类型
if($.browser.msie&&input[0].outerHTML){
var fakeHTML=$(输入[0].outerHTML.replace(/type=(['“])?密码\1/gi,'type=$1text$1');
this.fakePassword=fakeHTML.val(input.attr('placeholder')).addClass('placeholder').focus(function()){
input.trigger('focus');
$(this.hide();
input.show();//添加此代码
});
$(输入[0]。表单)。提交(函数(){
fakeHTML.remove();
input.show()
});
}
添加代码“input.show();“,您可以使输入不隐藏在IE8中。您应该在此处提供更多信息。根据您提供的链接,我发现了以下内容:。可能是相同的问题……我不知道。如果不是,请添加更多信息和示例。您只提供了插件的链接。所以请询问他!!!(顺便说一下,它与IE6+一起工作……)