how to disable save password prompt in chrome [dup

2019-01-29 08:23发布

问题:

This question already has an answer here:

  • Input type=password, don't let browser remember the password 13 answers

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

回答1:

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 */ }


回答2:

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.