6 个回答
<input style="display:none" type="text />
<input type="password />

=>

<input type="text />
<input  style="display:none" type="password />

还有一种是浏览器自带

用js控制,默认input的type为text,点击眼睛后把input的type改为password

密码 : input type=password
明文 : input type=text

点击眼睛改变input type属性为password就好了

type=password
type=text

我的想法比较简单,默认输入框是 type=password,点眼睛后,变成 type=text ...

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题