How to clear the history of multiple Input Input box?

preface

Definition and Usage

The AutoComplete property specifies whether the autocomplete feature should be enabled for the input field.

Autocompletion allows the browser to predict the input to the field. When the user starts typing in the field, the browser should display the options to fill in the field based on the values previously typed.

Note:

The autocomplete property applies to <form>, as well as the following <input> types: text, search, URL, telephone, email, password, datepickers, range, and color.Copy the code

Grammar:

<input autocomplete="value">
Copy the code
Attribute Value Value Description on Default. Specifies that autocomplete be enabled. Off disables autocomplete.Copy the code

For example,

In the following code: Autocomplete is enabled for the form, but in type=”email”, autocomplete is disabled:







<form action="demo_form.asp" method="get" autocomplete="on">
  First name:<input type="text" name="fname" /><br />
  Last name: <input type="text" name="lname" /><br />
  E-mail: <input type="email" name="email" autocomplete="off" /><br />
  <input type="submit" />
</form>
Copy the code

How does it work?

The AutoComplete property is new in HTML5.

  • When the attribute value=”on”, the auto-complete function will be enabled, and the browser will cache the historical input values, so that the customer can quickly select and input the historical records next time.

  • When value=”off”, autocomplete will be turned off to prevent browser software or malicious plug-ins from intercepting customer historical input. Prevent leaks;

Value =”off” does not work for Chrome; Set the value to “new-password”

MDN’s introduction to AutoComplete