How to set it to prohibit the browser from automatically saving form information, such as username and password?
Now many browsers have automatic filling function. I use autocomplete="off" on input, but some browsers still remember the username and password. Is there any more effective and easy way to prevent the browser from remembering the username and password?
1. Remember passwords for browsers
1). First of all, most browsers judge the password domain based on the type="password" of the form field, so for this situation, you can adopt the method of "dynamic setting of password domain":
Copy the codeThe code is as follows:
<input type="text" name="password" onfocus="='password'" />
Explanation: When this document box gets focus, it is turned into a password domain, so that the browser will not remember the password. Of course, in order to be more perfect, you can also add the autocomplete="off" attribute.
2). In the onload event, clear the value of the password box, that is:
Copy the codeThe code is as follows:
<script language="javascript">
= function(){
('Password Domain ID').value='';
};
</script>
3). The page adopts the https protocol because https will not save information on the form.
4). Use flash as the login form, and in this case, the browser will not record the form information.
2. Automatic form filling function for some browser plug-ins
This is more troublesome. I think this situation should be that the plug-in remembers the value of the form field name and then fills in the form. In this case, I think the value of the name can be dynamically changed when the page is loaded, and when submitting the form, the value of the form is combined into the correct corresponding value before submitting. This has not been verified, it is just my personal opinion. You can try
If the above methods still cannot satisfy you, then I have no choice.
suggestion:
Try to clear the cookies under the corresponding domain name. The browser should remember the username and password based on the cookies.
(No, some browsers remember it according to the value you submitted after you submit the form)
(Yes, some browsers do not record COOKIE. This is a headache. By the way, how to clear the values entered in INPUT? I hope that the values entered will no longer appear like the ones in the bank)
The way a browser can remember passwords is to find the input input box with type password, and then remember the input box in the previous one as the user name. So the solution to this problem is to add a type text input box between the username input and password input to set the css attribute display to none.