Home >Web Front-end >JS Tutorial >Solution to the bug that the autocomplete='off' setting does not work in Firefox_javascript skills

Solution to the bug that the autocomplete='off' setting does not work in Firefox_javascript skills

WBOY
WBOYOriginal
2016-05-16 18:09:051085browse

Auto-completion has also become automatic. The most classic one is Google’s search box. After entering a letter, the user will be given many prompts to choose from.

Solution to the bug that the autocomplete='off' setting does not work in Firefox_javascript skills

Looking at the source code, you will find that autocomplete="off" is added to the input box. This is to block the default memory function of the browser form. The search boxes of Taobao and Baidu also have this attribute. The autocomplete attribute is non-standard. It was first added in IE5 and later supported by other browsers. html5 also makes its lists standard.

But there is a bug in Firefox. After the first submission, FF will prompt whether to remember the password of a certain website. After clicking "Remember", setting autocomplete="off" in input[type=text] will not work. As follows

Copy the code The code is as follows:


< html>

Firefox autocomplete="off" bug








< ;/html>

The default setting of FF is "Remember website password"

Solution to the bug that the autocomplete='off' setting does not work in Firefox_javascript skills
There are two situations:
1. There is no input[type=password] in the form, autocomplete="off" will work
2. Remove the form and set input[type= text]’s autocomplete also works

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn