input禁止自动填充

1、在form表单或者input中使用autocomplete=”off”

2、不让页面读取缓存数据

<meta   http-equiv= "Pragma"   content= "no-cache" />
<meta   http-equiv= "Cache-Control"   content= "no-cache" />
<meta   http-equiv= "Expires"   content= "0" />

3、对于type=“password”时禁止自动填充密码的方法有两种:

(1)去掉input的name和id属性(不推荐)

(2)加上autocomplete="new-password"属性

posted @ 2021-07-31 14:56  珂珂keo  阅读(1252)  评论(0编辑  收藏  举报