HTML <input> Tag with the 'autocomplete' Attribute

<form name="myForm" action="">
<input type="text" name="oneTimeKey" autocomplete="off">


The above example demonstrates usage of the <input> element with the autocomplete attribute.

The autocomplete attribute allows you to specify whether the user agent/browser should provide an autocomplete feature. An autocomplete feature assists users in completing forms by automatically populating form fields that it "remembers" from previous inputs.

While autocomplete feature can often be a convenience, it can also be an inconvenience at times (such as in the case of one-time-keys for a banking login). It can also be potentially dangerous for the user if used on fields that contain sensitive information. The autocomplete attribute allows you to disable autocomplete on fields that shouldn't provide this feature.

Here are the values you can use with the autocomplete attribute:

  • on (default value)
  • off