版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_40639990/article/details/90379279
使用代码$("#pwd").attr("type","password")时出现上面的错误。
猜测是该版本jQuery不允许修改控件type属性,使用原生js语句可以解决这个问题。
if ($(this).attr("type") == "text") {
$(this)[0].type = "password";
}