HTML / CSS:如何使“密码”输入显示密码? [英] HTML/CSS: How to make "password" input show the password?

查看:1572
本文介绍了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.

如果您需要动态切换字段类型,那么 HOWOTO on codingforums.com 以及一些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 change input type
  • Changing the <input> type in IE with JavaScript
  • Javascript change input type dynamically doesnt work on IE8
  • JQuery change type of input field

要确保浏览器保持正常行为(保存/不保存密码),您可以在提交后将其转换回密码字段。

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:如何使“密码”输入显示密码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆