Solve the problem that the browser will automatically fill the password

There is a phenomenon in the front-end development process:
there is a login and registration pop-up box. When we successfully log in from the login pop-up box, chrome will pop up a prompt box whether to save the password, click the save password button, and then log out of the account, then open In the registration pop-up box, you will find that the user name and password in the registration pop-up box are also filled in by default (it is logical to fill in the login pop-up box by default)
but! Sometimes we don’t need this default display function in some other scenarios , because how?

Check out the data solution
and add it on the form or input autoComplete='off'
, but it doesn’t take effect in chrome

insert image description here

原因: form中有input[type=password],autocomplete=”off”将不起作用
Deleting the input[type=password] will work, but often the account and password appear at the same
time. At this time, you only need to set it in the input[type=password] box
autocomplete="new-password"to solve the problem.
insert image description here

Guess you like

Origin blog.csdn.net/zm_miner/article/details/124242009