HTML/CSS: How to make quot;passwordquot; input show the password?(HTML/CSS:如何制作“密码输入显示密码?)
问题描述
如何使密码字段中的值可见?因此,在字段中输入密码时,它不会显示黑点,而是显示您输入的实际值.
How can you make the value in the password field visible? So, when typing your password in the field, it will not show the black dots, but the actual value that you are typing.
谢谢!
好的,那么一个更好的问题可能是:如何强制浏览器记住此密码"字段中的值并将其视为密码?
edit: Ok, so then a better question might be: How can I force the browser to remember the value in this 'password' field and treat it as a password?
推荐答案
不要让它成为密码字段,让它成为一个普通的文本框.
Don't make it a password field, make it a normal text box.
如果需要动态切换字段类型,codingforums.com上有一个HOWOTO over,还有几个 SO 问题:
If you need to switch the field type dynamically, there is a HOWOTO over on codingforums.com, and also several SO questions:
- Javascript IE6/7/8 更改输入类型李>
- 更改 <input>用 JavaScript 输入 IE
- Javascript 动态更改输入类型在 IE8 上不起作用一个>
- 使用 jQuery 更改输入字段的类型
为确保浏览器保持正常行为(保存/不保存密码),您可以在提交时将其转换回密码字段.
To ensure that browsers keep their normal behavior (saving/not saving passwords) you can convert this back to a password field upon submit.
这篇关于HTML/CSS:如何制作“密码"输入显示密码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:HTML/CSS:如何制作“密码"输入显示密码?


- Fetch API 如何获取响应体? 2022-01-01
- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01
- 失败的 Canvas 360 jquery 插件 2022-01-01
- addEventListener 在 IE 11 中不起作用 2022-01-01
- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06
- 400或500级别的HTTP响应 2022-01-01
- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07
- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01
- Flexslider 箭头未正确显示 2022-01-01
- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01