Home > Web Front-end > HTML Tutorial > Two ways to disable clearing input text input cache in html_HTML/Xhtml_Web page production

Two ways to disable clearing input text input cache in html_HTML/Xhtml_Web page production

WBOY
Release: 2016-05-16 16:36:43
Original
1606 people have browsed it

Most browsers will cache the input value by default. Only by using ctl F5 to force refresh can the cache records be cleared.

If you don’t want the browser to cache the input value, there are two methods:

 Method 1:

Add

to the input that does not want to be cached
XML/HTML CodeCopy content to clipboard
  1. autocomplete="off";eg:
  2. <input type="text" autocomplete="off" name="test" />

 Method 2:

Add

in the form tag where the input is located
XML/HTML CodeCopy content to clipboard
  1. autocomplete="off";eg:
  2. <form action="#" autocomplete="off">
  3. <input type="text" autocomplete="off" name="test" />
  4. form>
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template