{"id":9355,"date":"2022-10-06T05:05:29","date_gmt":"2022-10-06T05:05:29","guid":{"rendered":"https:\/\/mdr.foobrdigital.com\/?p=9355"},"modified":"2022-10-06T05:05:29","modified_gmt":"2022-10-06T05:05:29","slug":"html-autocomplete-attribute","status":"publish","type":"post","link":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/2022\/10\/06\/html-autocomplete-attribute\/","title":{"rendered":"HTML Autocomplete Attribute"},"content":{"rendered":"\n<p>The&nbsp;autocomplete&nbsp;attribute defines if an input or a form field must have the autocomplete &#8220;on&#8221; or &#8220;off&#8221;.<\/p>\n\n\n\n<p>With the&nbsp;autocomplete&nbsp;attribute the browser predicts the value, and when a user starts typing in a field, the browser displays options to fill in the field, based on earlier typed values.<\/p>\n\n\n\n<p>The autocomplete can be &#8220;on&#8221; for the input, and &#8220;off&#8221; for particular input fields, or vice versa.<\/p>\n\n\n\n<p>Note: The&nbsp;autocomplete&nbsp;attribute works with such &lt;input&gt; types, like text, search, tel, url, password, email, range, and color.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"syntax-4\">Syntax<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;input autocomplete=\"on|off\"&gt;<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>Applies to<\/td><td>&lt;form>\u00a0and\u00a0&lt;input>\u00a0elements.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"example-of-the-html-span-class-attribute-autocomplete-span-attribute-7\">Example of the HTML&nbsp;autocomplete&nbsp;attribute:<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n  &lt;head&gt;\n    &lt;title&gt;Title of the document&lt;\/title&gt;\n    &lt;style&gt;\n      div {\n        margin-bottom: 10px;\n      }\n    &lt;\/style&gt;\n  &lt;\/head&gt;\n  &lt;body&gt;\n    &lt;form action=\"\/form\/submit\" method=\"get\" autocomplete=\"on\"&gt;\n      &lt;div&gt;\n        &lt;label for=\"name\"&gt;Enter Your Name:&lt;\/label&gt;\n        &lt;input type=\"text\" name=\"name\" id=\"name\"&gt;\n      &lt;\/div&gt;\n      &lt;div&gt;\n        &lt;label for=\"phone\"&gt;Enter Your Phone Number:&lt;\/label&gt;\n        &lt;input type=\"number\" id=\"phone\" name=\"phone-number\"&gt;\n        &lt;br&gt;\n      &lt;\/div&gt;\n      &lt;input type=\"submit\" value=\"Send\"&gt;\n    &lt;\/form&gt;\n  &lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"example-of-the-html-lt-form-gt-tag-where-the-span-class-attribute-autocomplete-span-attribute-is-on-9\">Example of the HTML &lt;form&gt; tag where the&nbsp;autocomplete&nbsp;attribute is on:<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n  &lt;head&gt;\n    &lt;title&gt;Title of the document&lt;\/title&gt;\n    &lt;style&gt;\n      input {\n        display: block;\n        margin-bottom: 10px;\n        padding: 10px;\n      }\n    &lt;\/style&gt;\n  &lt;\/head&gt;\n  &lt;body&gt;\n    &lt;form action=\"\/form\/submit\" accept-charset=\"ISO-8859-1\"&gt;\n      &lt;input type=\"text\" name=\"name\" placeholder=\"Enter your Name\" autofocus&gt;\n      &lt;input type=\"text\" name=\"surname\" placeholder=\"Enter your Surname\"&gt;\n      &lt;input type=\"number\" name=\"age\" placeholder=\"Enter your Age\" autocomplete=\"off\"&gt;\n      &lt;input type=\"submit\" value=\"Send\"&gt;\n    &lt;\/form&gt;\n  &lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The&nbsp;autocomplete&nbsp;attribute defines if an input or a form field must have the autocomplete &#8220;on&#8221; or &#8220;off&#8221;. With the&nbsp;autocomplete&nbsp;attribute the browser predicts the value, and when a user starts typing in a field, the browser displays options to fill in the field, based on earlier typed values. The autocomplete can be &#8220;on&#8221; for the input, and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[327],"tags":[],"_links":{"self":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts\/9355"}],"collection":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/comments?post=9355"}],"version-history":[{"count":0,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts\/9355\/revisions"}],"wp:attachment":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/media?parent=9355"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/categories?post=9355"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/tags?post=9355"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}