input autocomplete Attribute - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:input

Description

The autocomplete attribute sets if an input field should have autocomplete enabled.

Autocomplete allows the browser to predict the value.

The autocomplete attribute works with the following <input> types: text, search, url, tel, email, password, datepickers, range, and color.

Attribute Values

Value Description
onDefault. Specifies that autocomplete is on (enabled)
off Specifies that autocomplete is off (disabled)

An HTML form with autocomplete on (and off for one input field):

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<form action="/action_page.php" 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><!--from ww  w  .  j  a  va2s  .  co  m-->

</body>
</html>

Related Tutorials