jquery中的onblur和onfocus事件;无法在IE浏览器上正常工作

jquery中的onblur和onfocus事件;无法在IE浏览器上正常工作,jquery,razor,Jquery,Razor,我使用onblur和onfocus事件调用函数,将文本框类型切换为密码或文本 @Html.TextBoxFor(m=>m.FinanceModel.VatNumber,新的{@type=“password”,@class=“form control capitalize”,maxlength=30,@onblur=“setTypePassword(this);”,@onfocus=“setTypeText(this);”}) 更改在Chrome浏览器上工作正常,但有时在IE浏览器上工作不正常。I

我使用onblur和onfocus事件调用函数,将文本框类型切换为密码或文本

@Html.TextBoxFor(m=>m.FinanceModel.VatNumber,新的{@type=“password”,@class=“form control capitalize”,maxlength=30,@onblur=“setTypePassword(this);”,@onfocus=“setTypeText(this);”})


更改在Chrome浏览器上工作正常,但有时在IE浏览器上工作不正常。

IE不允许您更改输入字段的属性类型。 但您可以保留两个输入,一个输入type=“password”,另一个输入type=“text” 然后显示隐藏,然后聚焦和模糊事件&它与IE一起在所有浏览器中工作:-)