how to disable save password prompt in chrome [dup

2019-01-29 07:31发布

This question already has an answer here:

I have been searching since couple of hours for this problem but not found any appropriate solution for this problem,the problem is I am having three input forms on my page every time I save the form values it ask me to save password in chrome how can I solve this problem using JavaScript or query

 <input type="password"  autocomplete="off"/>

i have tried autocomplete='off' but it does not work

2条回答
Luminary・发光体
2楼-- · 2019-01-29 08:26

autocomplete="off" is the right code, but many browsers don't want to support it. They want to let the user chose instead of the code itself. So you can write it, but browser can choose to not read it.

查看更多
别忘想泡老子
3楼-- · 2019-01-29 08:31

Best way is to change your password type to text and replace the characters with asterisks or dots whatever you like.

change <input type="password" /> to <input type="text" id="password" style="-webkit-text-security: disc;"/>

There are other options as well:

input { -webkit-text-security: none; }
input { -webkit-text-security: circle; }
input { -webkit-text-security: square; }
input { -webkit-text-security: disc; /* Default */ }
查看更多
登录 后发表回答