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
WBOYOriginal
2016-05-16 16:36:431594browse

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>
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