How to specify whether an input element should have autocomplete disabled or not ?
The autocomplete attribute specifies whether an autocomplete input field should be enabled. The browser can predict the value using autocomplete. The browsing options to fill in the field, based on earlier typed values, should be shown for the user while typing a field.
If the autocomplete feature is enabled, the browser will suggest values based on what users have previously entered the field. If the autocomplete feature is disabled, the browser will not show the values automatically, depending on the previous users.
Note: Text, search, URL, mobile, email, password, date pickers, range, and color, all work with the autocomplete attribute.
- on: This is the default setting. It states that autocomplete is enabled.
- off: This states that the autocomplete is disabled.
Example 1: The following example demonstrates the disabled state of autocomplete feature. In this case, the browser will not show the values automatically, entered by the previous users.
Example 2: The following example demonstrates the enabled state of autocomplete feature. When autocomplete is turned on, then the browser will suggest values based on what users have previously entered the field.
Please Login to comment...