Simple and practical method to prevent browsers from remembering user names and passwords _ javascript skills

Source: Internet
Author: User
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:


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.