{"id":4633,"date":"2015-06-01T12:15:38","date_gmt":"2015-06-01T09:15:38","guid":{"rendered":"http:\/\/www.webcodegeeks.com\/?p=4633"},"modified":"2017-12-19T13:57:56","modified_gmt":"2017-12-19T11:57:56","slug":"html5-autocomplete-example","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/html5\/html5-autocomplete-example\/","title":{"rendered":"HTML5 AutoComplete Example"},"content":{"rendered":"<p>In this article I will show you an example on how to create an autocomplete input using HTML5.<\/p>\n<p>First I will present you what HTML5 added to create autocomplete fields.<\/p>\n<p>Then we will create a real example, with data loaded from a server request (aJax).<\/p>\n<h2>1. Elements and attributes <\/h2>\n<h3>1.1 The autocomplete attribute<\/h3>\n<blockquote><p><strong>IMPORTANT<\/strong> : This attribute is not used to create autocomplete field but to turn off the form autocompletion by the browser &#8230;<\/p><\/blockquote>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;form method=&quot;post&quot; autocomplete=&quot;off&quot; action=&quot;post.php&quot;&gt;\r\n    &lt;!-- Some form elements ...--&gt;\r\n&lt;\/form&gt;\r\n<\/pre>\n<p>With the example above, the browser will not try to fill the form elements itself.<\/p>\n<blockquote><p><strong>NOTE<\/strong> : This attribute was introduced in IE 5 ! So it&#8217;s not from HTML5 &#8230;<\/p><\/blockquote>\n<p>I presented this attribute just to remove any ambiguity.<\/p>\n<p>[ulp id=&#8217;tgm4cmEWcKUikZNn&#8217;]<\/p>\n<h3>1.2 The datalist element<\/h3>\n<p>HTML5 introduced the <code>datalist<\/code> tag, this is &#8220;THE&#8221; tag to create autocomplete field.<\/p>\n<p>The element can contain some <code>option<\/code>.<\/p>\n<p>The <code>datalist<\/code> has no <em>representation<\/em> if it&#8217;s not linked to an input field, for example the code below will show an empty document :<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head lang=&quot;en&quot;&gt;\r\n    &lt;meta charset=&quot;UTF-8&quot;&gt;\r\n    &lt;title&gt;HTML5 Autocomplete Example - First&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;datalist&gt;\r\n    &lt;option&gt;Paris&lt;\/option&gt;\r\n    &lt;option&gt;London&lt;\/option&gt;\r\n    &lt;option&gt;Brussels&lt;\/option&gt;\r\n    &lt;option&gt;Madrid&lt;\/option&gt;\r\n    &lt;option&gt;Roma&lt;\/option&gt;\r\n    &lt;option&gt;Dublin&lt;\/option&gt;\r\n    &lt;option&gt;Berlin&lt;\/option&gt;\r\n    &lt;option&gt;Bucharest&lt;\/option&gt;\r\n&lt;\/datalist&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<figure id=\"attachment_4635\" aria-describedby=\"caption-attachment-4635\" style=\"width: 800px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/05\/first.png\"><img decoding=\"async\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/05\/first.png\" alt=\"html5 autocomplete example - first\" width=\"800\" height=\"600\" class=\"size-full wp-image-4635\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/05\/first.png 800w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/05\/first-300x225.png 300w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><figcaption id=\"caption-attachment-4635\" class=\"wp-caption-text\">html5 autocomplete example &#8211; first<\/figcaption><\/figure>\n<h3>1.3 Link the datalist<\/h3>\n<p>Then if you link the datalist to an input field you will have an autocomplete field &#8230;<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head lang=&quot;en&quot;&gt;\r\n    &lt;meta charset=&quot;UTF-8&quot;&gt;\r\n    &lt;title&gt;HTML5 Autocomplete Example - First&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;input type=&quot;text&quot; list=&quot;capitals&quot; \/&gt;\r\n&lt;datalist id=&quot;capitals&quot;&gt;\r\n    &lt;option&gt;Paris&lt;\/option&gt;\r\n    &lt;option&gt;London&lt;\/option&gt;\r\n    &lt;option&gt;Brussels&lt;\/option&gt;\r\n    &lt;option&gt;Madrid&lt;\/option&gt;\r\n    &lt;option&gt;Roma&lt;\/option&gt;\r\n    &lt;option&gt;Dublin&lt;\/option&gt;\r\n    &lt;option&gt;Berlin&lt;\/option&gt;\r\n    &lt;option&gt;Bucharest&lt;\/option&gt;\r\n&lt;\/datalist&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><figure id=\"attachment_4638\" aria-describedby=\"caption-attachment-4638\" style=\"width: 800px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/05\/second.png\"><img decoding=\"async\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/05\/second.png\" alt=\"html5 autocomplete example - second\" width=\"800\" height=\"600\" class=\"size-full wp-image-4638\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/05\/second.png 800w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/05\/second-300x225.png 300w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><figcaption id=\"caption-attachment-4638\" class=\"wp-caption-text\">html5 autocomplete example &#8211; second<\/figcaption><\/figure><br \/>\nVery simple no ?<\/p>\n<p>Let see a full example.<\/p>\n<h2>2. Full Example<\/h2>\n<p>In this example we will create an autocomplete field with data retrieved from an Ajax Request.<\/p>\n<h3>2.1 Why jQuery<\/h3>\n<p>In this example we will use the jQuery library. I inject the library by passing it as a dependency of my code :<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n(function($){\r\n    'use strict';\r\n\r\n})(jQuery);\r\n<\/pre>\n<p>This allows me to isolate my code, and to show the reader that jQuery is needed, and that my code depends on it &#8230;<\/p>\n<p>This library uses the <code>$<\/code> symbol as a function name.<\/p>\n<p>In the code I&#8217;ve used it 3 times :<\/p>\n<ul>\n<li>First as a shorthand to the <code>load<\/code> event : <code>$( functionLoadHandler );<\/code><\/li>\n<li>Second in the <code>loadDatas<\/code> function. I&#8217;ve use the <code>$.getJSON( urlToJSONData, callbackHandler); <\/code>. This function will make a request (AJAX) to the <code>urlToJSONData<\/code>, parse the response in JSON, then pass it to the <code>callbackHandler<\/code> function.<\/li>\n<li>Third in the <code>createList<\/code> function. There, I&#8217;ve used jQuery to manipulate the DOM, retrieve element (with id <code>capitallist<\/code>), create elements (<code>option<\/code>) , and append the created element to the retrieved element.<\/li>\n<\/ul>\n<h3>2.2 The Base document<\/h3>\n<p>Here is the HTML Document :<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head lang=&quot;en&quot;&gt;\r\n    &lt;meta charset=&quot;UTF-8&quot;&gt;\r\n    &lt;title&gt;HTML5 Autocomplete Example - &lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;h2&gt;Enter the first letters of a city ...&lt;\/h2&gt;\r\n&lt;input type=&quot;text&quot; name=&quot;capitals&quot; list=&quot;capitallist&quot; id=&quot;capitals&quot; placeholder=&quot;capital ...&quot; \/&gt;\r\n&lt;datalist id=&quot;capitallist&quot;&gt;&lt;\/datalist&gt;\r\n\r\n\r\n&lt;script src=&quot;https:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/2.1.4\/jquery.min.js&quot;&gt;&lt;\/script&gt;\r\n&lt;script src=&quot;script.js&quot;&gt;&lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>As you can see, I will use jQuery for the Ajax Request but also for the DOM manipulation.<\/p>\n<p>I have created and empty <code>datalist<\/code> that will contains the <code>option<\/code> elements.<\/p>\n<h3>2.3 The JSON datas <\/h3>\n<p>I made a Google search to find a list of World capitals, and I&#8217;ve found this <a href=\"http:\/\/techslides.com\/list-of-countries-and-capitals\" target=\"_blank\">article<\/a>, and this file :<br \/>\n<a href=\"http:\/\/techslides.com\/demos\/country-capitals.json\" target=\"_blank\">http:\/\/techslides.com\/demos\/country-capitals.json<\/a>.<\/p>\n<p>The structure of a model is :<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n{\r\n    &quot;CountryName&quot;:&quot;France&quot;,\r\n    &quot;CapitalName&quot;:&quot;Paris&quot;,\r\n    &quot;CapitalLatitude&quot;:&quot;48.86666666666667&quot;,\r\n    &quot;CapitalLongitude&quot;:&quot;2.333333&quot;,\r\n    &quot;CountryCode&quot;:&quot;FR&quot;,\r\n    &quot;ContinentName&quot;:&quot;Europe&quot;\r\n}\r\n<\/pre>\n<p>As you can see there is more data than I need so I will have to extract capital names from the list.<\/p>\n<h3>2.4 The JavaScript code<\/h3>\n<p>We can create a JavaScript function to make the Ajax Request :<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n\/\/ The JSON list url\r\nvar capitals = &quot;country-capitals.json&quot;;\r\n\r\n\/**\r\n * Load data and call callback function\r\n * @param {Function} callback\r\n *\/\r\nfunction loadDatas( callback ){\r\n\r\n    \/\/ Make the ajax call\r\n    $.getJSON(capitals, function(list){\r\n        \/\/ create the Capitals array\r\n        var capitals =&#x5B;];\r\n        for(var i=0; i &lt; list.length; i++){\r\n            capitals.push(list&#x5B;i].CapitalName);\r\n        }\r\n        \/\/ Call the function that will create the options\r\n        \/\/ But sort the array first (for better user experience)\r\n        callback(capitals.sort());\r\n    });\r\n}\r\n<\/pre>\n<p>Then a function that will create the options in the <code>datalist<\/code> elements :<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n\/**\r\n * Create the options from the capitals array\r\n * @param {Array} capitals\r\n *\/\r\nfunction createList(capitals) {\r\n    \/\/ get the datalist element\r\n    var datalist = $(&quot;#capitallist&quot;);\r\n\r\n    \/\/ Fill it with the capitals array\r\n    for(var i=0; i &lt; capitals.length; i++){\r\n        $('&lt;option&gt;'+capitals&#x5B;i]+'&lt;\/option&gt;').appendTo(datalist);\r\n    }\r\n}\r\n<\/pre>\n<p>And then all together &#8230;<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n(function($){\r\n    'use strict';\r\n\r\n    \/\/ The JSON list url\r\n    var capitals = &quot;country-capitals.json&quot;;\r\n\r\n    \/**\r\n     * Create the options from the capitals array\r\n     * @param {Array} capitals\r\n     *\/\r\n    function createList(capitals) {\r\n        \/\/ get the datalist element\r\n        var datalist = $(&quot;#capitallist&quot;);\r\n\r\n        \/\/ Fill it with the capitals array\r\n        for(var i=0; i &lt; capitals.length; i++){\r\n            $('&lt;option&gt;'+capitals&#x5B;i]+'&lt;\/option&gt;').appendTo(datalist);\r\n        }\r\n    }\r\n\r\n\r\n    \/**\r\n     * Load data and call callback function\r\n     * @param {Function} callback\r\n     *\/\r\n    function loadDatas( callback ){\r\n\r\n        \/\/ Make the ajax call\r\n        $.getJSON(capitals, function(list){\r\n            \/\/ create the Capitals array\r\n            var capitals =&#x5B;];\r\n            for(var i=0; i &lt; list.length; i++){\r\n                capitals.push(list&#x5B;i].CapitalName);\r\n            }\r\n            \/\/ Call the function that will create the options\r\n            \/\/ But sort the array first (for better user experience)\r\n            callback(capitals.sort());\r\n        });\r\n    }\r\n\r\n    \/\/ jQuery OnLoad ...\r\n    $(function(){\r\n        loadDatas( createList );\r\n    });\r\n\r\n})(jQuery);\r\n<\/pre>\n<figure id=\"attachment_4636\" aria-describedby=\"caption-attachment-4636\" style=\"width: 800px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/05\/full.png\"><img decoding=\"async\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/05\/full.png\" alt=\"html5 autocomplete example - full\" width=\"800\" height=\"600\" class=\"size-full wp-image-4636\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/05\/full.png 800w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/05\/full-300x225.png 300w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><figcaption id=\"caption-attachment-4636\" class=\"wp-caption-text\">html5 autocomplete example &#8211; full<\/figcaption><\/figure>\n<h2>3. Download<\/h2>\n<div class=\"download\"><strong>Download<\/strong><br \/>\n    You can download the full source code of this example here: <a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/05\/html5_autocomplete_example.zip\"><strong>HTML5 AutoComplete Example<\/strong><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this article I will show you an example on how to create an autocomplete input using HTML5. First I will present you what HTML5 added to create autocomplete fields. Then we will create a real example, with data loaded from a server request (aJax). 1. Elements and attributes 1.1 The autocomplete attribute IMPORTANT : &hellip;<\/p>\n","protected":false},"author":46,"featured_media":914,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-4633","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-html5"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>HTML5 AutoComplete Example - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"In this article I will show you an example on how to create an autocomplete input using HTML5. First I will present you what HTML5 added to create\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webcodegeeks.com\/html5\/html5-autocomplete-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"HTML5 AutoComplete Example - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"In this article I will show you an example on how to create an autocomplete input using HTML5. First I will present you what HTML5 added to create\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/html5\/html5-autocomplete-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2015-06-01T09:15:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-12-19T11:57:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Remi Goyard\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@mimiz33\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Remi Goyard\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-autocomplete-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-autocomplete-example\/\"},\"author\":{\"name\":\"Remi Goyard\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/ae15332f888fcdc376a8d4e03180e242\"},\"headline\":\"HTML5 AutoComplete Example\",\"datePublished\":\"2015-06-01T09:15:38+00:00\",\"dateModified\":\"2017-12-19T11:57:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-autocomplete-example\/\"},\"wordCount\":1172,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-autocomplete-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg\",\"articleSection\":[\"HTML5\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/html5\/html5-autocomplete-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-autocomplete-example\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-autocomplete-example\/\",\"name\":\"HTML5 AutoComplete Example - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-autocomplete-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-autocomplete-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg\",\"datePublished\":\"2015-06-01T09:15:38+00:00\",\"dateModified\":\"2017-12-19T11:57:56+00:00\",\"description\":\"In this article I will show you an example on how to create an autocomplete input using HTML5. First I will present you what HTML5 added to create\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-autocomplete-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/html5\/html5-autocomplete-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-autocomplete-example\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-autocomplete-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"HTML5\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/html5\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"HTML5 AutoComplete Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/ae15332f888fcdc376a8d4e03180e242\",\"name\":\"Remi Goyard\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/caa839a88ba9d485eec370ff8e020c314f10fb2e4ddedb3424a4bf92198259b2?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/caa839a88ba9d485eec370ff8e020c314f10fb2e4ddedb3424a4bf92198259b2?s=96&d=mm&r=g\",\"caption\":\"Remi Goyard\"},\"description\":\"I'm a senior web architect. Passionated by new technologies, programming, devops tools, and agile methodologies. I really enjoy to coach, or teach, people who wants to learn programming, from beginners to skilled programmers. Involved in local developer communities, Java User Group, PHP User Group, or Javascript User Group, i like to share with others about experiences, news or business. Coding is FUN !\",\"sameAs\":[\"http:\/\/www.mimiz.fr\/\",\"http:\/\/fr.linkedin.com\/in\/remigoyard\/en\",\"https:\/\/x.com\/@mimiz33\"],\"url\":\"https:\/\/www.webcodegeeks.com\/author\/remi-goyard\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"HTML5 AutoComplete Example - Web Code Geeks - 2026","description":"In this article I will show you an example on how to create an autocomplete input using HTML5. First I will present you what HTML5 added to create","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webcodegeeks.com\/html5\/html5-autocomplete-example\/","og_locale":"en_US","og_type":"article","og_title":"HTML5 AutoComplete Example - Web Code Geeks - 2026","og_description":"In this article I will show you an example on how to create an autocomplete input using HTML5. First I will present you what HTML5 added to create","og_url":"https:\/\/www.webcodegeeks.com\/html5\/html5-autocomplete-example\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_published_time":"2015-06-01T09:15:38+00:00","article_modified_time":"2017-12-19T11:57:56+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg","type":"image\/jpeg"}],"author":"Remi Goyard","twitter_card":"summary_large_image","twitter_creator":"@mimiz33","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Remi Goyard","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-autocomplete-example\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-autocomplete-example\/"},"author":{"name":"Remi Goyard","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/ae15332f888fcdc376a8d4e03180e242"},"headline":"HTML5 AutoComplete Example","datePublished":"2015-06-01T09:15:38+00:00","dateModified":"2017-12-19T11:57:56+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-autocomplete-example\/"},"wordCount":1172,"commentCount":0,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-autocomplete-example\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg","articleSection":["HTML5"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/html5\/html5-autocomplete-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-autocomplete-example\/","url":"https:\/\/www.webcodegeeks.com\/html5\/html5-autocomplete-example\/","name":"HTML5 AutoComplete Example - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-autocomplete-example\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-autocomplete-example\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg","datePublished":"2015-06-01T09:15:38+00:00","dateModified":"2017-12-19T11:57:56+00:00","description":"In this article I will show you an example on how to create an autocomplete input using HTML5. First I will present you what HTML5 added to create","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-autocomplete-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/html5\/html5-autocomplete-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-autocomplete-example\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-autocomplete-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"HTML5","item":"https:\/\/www.webcodegeeks.com\/category\/html5\/"},{"@type":"ListItem","position":3,"name":"HTML5 AutoComplete Example"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/ae15332f888fcdc376a8d4e03180e242","name":"Remi Goyard","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/caa839a88ba9d485eec370ff8e020c314f10fb2e4ddedb3424a4bf92198259b2?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/caa839a88ba9d485eec370ff8e020c314f10fb2e4ddedb3424a4bf92198259b2?s=96&d=mm&r=g","caption":"Remi Goyard"},"description":"I'm a senior web architect. Passionated by new technologies, programming, devops tools, and agile methodologies. I really enjoy to coach, or teach, people who wants to learn programming, from beginners to skilled programmers. Involved in local developer communities, Java User Group, PHP User Group, or Javascript User Group, i like to share with others about experiences, news or business. Coding is FUN !","sameAs":["http:\/\/www.mimiz.fr\/","http:\/\/fr.linkedin.com\/in\/remigoyard\/en","https:\/\/x.com\/@mimiz33"],"url":"https:\/\/www.webcodegeeks.com\/author\/remi-goyard\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/4633","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/46"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=4633"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/4633\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/914"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=4633"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=4633"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=4633"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}