What is HTML autocomplete Attribute?

HTML, HTML Attributes , 0 Comments

The autocomplete attribute indicates that an <input>, <textarea> or <form> tag shout have autocomplete on or off.

Autocomplete enables the value to be predicted by the browser. The browser should show suggestions to fill in the field when a user begins typing in a field depending on previously typed numbers, but they may also come from pre-configured values.

For example, for autocomplete purposes, a browser may allow the user to save their name, address, phone number, and email addresses.

Tag Support

You can use autocomplete attribute with <input>, <textarea> or <form> tag.

input/textarea Example

<input type="number" name="mobile" id="mobile" autocomplete="off">
<textarea name="cc-number" id="message" autocomplete="on"></textarea>

Form Example

<form action="action.php" method="get" autocomplete="on">
  First name:<input type="text" name="fname"><br>
  E-mail: <input type="email" name="email"><br>
  <input type="submit">

Browser Support

Data on support for the input-autocomplete-onoff feature across the major browsers from caniuse.com

Leave a Reply

Your email address will not be published.