10

兼容所有浏览器, 关闭记住密码的input的自动填充功能

 2 years ago
source link: https://www.geekjc.com/post/5e5d19b6512fb42b888dab6b
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
关注本文作者公众号获取最新福利

兼容所有浏览器, 关闭记住密码的input的自动填充功能

时间: 03/02/2020作者: ll浏览量: 697

当你在登陆页面选择了记住密码,会导致在后面修改密码的输入框中,直接自动填充密码.想要古娜彼自动填充.

1. 方法一:

在表单中创建一个不显示的input且type等于password

<input type="password"  style="position: absolute;z-index: -999">

由于密码直接填充到这个input中所以不会在真正的input上显示

2. 方法二

使用autocomplete="new-password"

<Input type='password'  autocomplete="new-password"/>

这是一个新属性,兼容所有浏览器.

autoComplete="new-password"

关注下面的标签,发现更多相似的文章

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK