【发布时间】:2013-09-05 09:57:24
【问题描述】:
在我的网站中,密码字段显示输入的值,而不是显示星号符号。这适用于所有其他浏览器。 IE7 和 IE9 也可以。仅在 IE8 中我没有得到它。任何帮助将不胜感激。
参考:只需检查网站并点击登录,就会出现登录框,您可以检查该密码字段的问题。
<input type="password" name="password" id="password" value="Password"
onblur="if(this.value == '') { this.style.color='#bbb'; this.value='Password'; this.type='text'}
else {this.type='password';}"
onfocus="if (this.value == 'Password') {this.style.color='#000'; this.value=''; this.type='password'} else {this.type='password';}" style="color: rgb(0, 0, 0);">
【问题讨论】:
-
@BenFortune 我不想让你登录,如果你只点击那个按钮就会出现一个弹出窗口,你可以看到问题
-
您在 IE 的第 291 行有错误..
-
您的实际站点上有
<input type="text" name="password"。您可能想尝试使用type="password",然后使用真正的占位符 polyfill 脚本而不是内联 JavaScript 废话。 -
@DipeshParmar —
this是 JavaScript 非常基础的部分。 IE 确实支持它。 -
@ManigandanArjunan 为什么要将 this.type 设置为模糊和焦点?直接在你的标签中设置 type="password"
标签: php html css internet-explorer-8