Many browsers use the autocomplete & quot; off & quot; function, but some browsers still remember the username and password, is there a more effective and convenient way to prevent the browser from remembering the user name and password? How can I disable the browser from automatically saving form information, such as the user name and password?
Currently, many browsers use the autocomplete = "off" function, but some browsers still remember the username and password, is there a more effective and convenient way to prevent the browser from remembering the user name and password?
1. Remember the password for the browser
1) First, most browsers determine the password field based on the type = "password" of the form field. In this case, you can use the "dynamically set the password field" method:
The Code is as follows:
Explanation: When this document box gets the focus, it is changed to a password domain, so that the browser will not remember the password. Of course, to improve the password, you can also add the autocomplete = "off" attribute.
2) In the onload event, clear the value of the password box, that is:
The Code is as follows: