{"id":15154,"date":"2012-10-08T21:01:42","date_gmt":"2012-10-08T13:01:42","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=15154"},"modified":"2025-04-04T01:13:02","modified_gmt":"2025-04-03T17:13:02","slug":"html5-form-input-type","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/html5-form-input-type\/","title":{"rendered":"Exploring HTML5 Form Input Types: Date, Color, and Range"},"content":{"rendered":"<p>Forms are ubiquitous across websites, serving as critical tools for user interaction. From logging into platforms like Facebook, Twitter, and Google to tweeting and updating statuses on social networks, forms facilitate essential online engagements. This article highlights the pivotal role of forms in website interaction, emphasizing the evolution and significance of input types with the advent of HTML5.<\/p>\n<p>Traditionally, web forms offered limited input types, including <code>text<\/code>, <code>password<\/code>, <code>radio<\/code>, <code>checkbox<\/code>, and <code>submit<\/code>. HTML5 has significantly expanded this repertoire, introducing a variety of new input types designed to enhance user experience and form functionality. This exploration delves into the innovative input types brought forth by HTML5, showcasing their utility and application.<\/p>\n<p>Let\u2019s embark on a journey through some of the most intriguing HTML5 Form inputs, shedding light on their potential to revolutionize web forms.<\/p>\n<h2>Exploring the Date Picker<\/h2>\n<p>Our first stop is the date picker, a common feature in registration forms and essential for services requiring date selection, such as flight and hotel bookings. While JavaScript libraries have long provided mechanisms to implement date pickers, HTML5 simplifies this process with its <code>date<\/code> input type:<\/p>\n<pre>\r\n &lt;input type=\"date\"&gt;\r\n<\/pre>\n<p>The HTML5 date picker mirrors the functionality of its JavaScript counterparts, offering an intuitive calendar pop-up for easy date navigation. However, browser support varies, with Chrome, Opera, and Safari each presenting the <code>date<\/code> input differently, leading to potential inconsistencies in user experience. Here\u2019s a look at how these browsers display the date picker:<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/html5-form-input-type\/datepicker-calendar.jpg\" alt=\"HTML5 Date Picker in Different Browsers\" width=\"500\" height=\"750\"><\/figure>\n<p>Each browser offers a unique take on the date picker, highlighting the need for standardized implementation to ensure a cohesive user experience.<\/p>\n<p>HTML5 also introduces specialized <code>input<\/code> types for more precise date and time selection, including <code>month<\/code>, <code>week<\/code>, <code>time<\/code>, <code>datetime<\/code>, and <code>datetime-local<\/code>. These inputs offer descriptive ways to specify dates or times:<\/p>\n<pre>\r\n &lt;input type=\"month\"&gt;\r\n &lt;input type=\"week\"&gt;\r\n &lt;input type=\"time\"&gt;\r\n &lt;input type=\"datetime\"&gt;\r\n &lt;input type=\"datetime-local\"&gt;\r\n<\/pre>\n<p>To see these inputs in action, visit the following demo. Note that Opera 11 and above is currently the only browser that fully supports all these input types:<\/p>\n<p><a href=\"https:\/\/hongkiat.github.io\/html5-form-input-type\/\" class=\"su-button su-button-style-flat\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:0px\" target=\"__blank\" rel=\"noopener nofollow\"><span style=\"color:#FFFFFF;padding:7px 20px;font-size:16px;line-height:24px;border-color:#6cadf4;border-radius:0px;text-shadow:none\"><i class=\"sui sui-external-link\" style=\"font-size:16px;color:#fff\"><\/i>  See demo <\/span><\/a><\/p>\n<h2>Introducing the Color Picker<\/h2>\n<p>The <strong>color picker<\/strong> is a vital tool in various web-based applications, including CSS3 gradient generators and other design tools. Traditionally, web developers have relied on JavaScript libraries, such as jsColor, to incorporate color pickers into their applications. However, HTML5 introduces a streamlined solution with its <code>color<\/code> input type, enabling the creation of native-browser color pickers:<\/p>\n<pre>\r\n &lt;input type=\"color\"&gt;\r\n<\/pre>\n<p>Different browsers, specifically Chrome and Opera, present this input type in their unique ways, highlighting the diversity in rendering:<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/html5-form-input-type\/colorpicker.jpg\" alt=\"HTML5 Color Picker in Chrome and Opera\" width=\"500\" height=\"600\"><\/figure>\n<div class=\"sue-icon-text su-image-caption\" data-url=\"\" data-target=\"self\" style=\"min-height:34px;padding-left:36px;color:#333333\">\n<div class=\"sue-icon-text-icon\" style=\"color:#333333;font-size:24px;width:24px;height:24px\"><i class=\"sui sui-photo\" style=\"font-size:24px;color:#333333\"><\/i><\/div>\n<div class=\"sue-icon-text-content su-u-trim\" style=\"color:#333333\">Comparison of the HTML5 Color Picker in Chrome and Opera.<\/div>\n<div style=\"clear:both;height:0\"><\/div>\n<\/div>\n<p>Opera offers a basic color selection and displays the hex format of the currently picked color in a dropdown menu. Chrome, on the other hand, presents a full color palette in a new window upon clicking the input field.<\/p>\n<p>Additionally, setting a default color is straightforward with the <code>value<\/code> attribute:<\/p>\n<pre>\r\n &lt;input type=\"color\" value=\"#ff0000\"&gt;\r\n<\/pre>\n<p>This feature ensures that, in browsers lacking support for the <code>color<\/code> input type, the field degrades gracefully to a text input. The default value then serves as a hint, guiding users on what to enter:<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/html5-form-input-type\/colorpicker-ff.jpg\" alt=\"Default Color in HTML5 Color Picker\" width=\"500\" height=\"116\"><\/figure>\n<div class=\"sue-icon-text su-image-caption\" data-url=\"\" data-target=\"self\" style=\"min-height:34px;padding-left:36px;color:#333333\">\n<div class=\"sue-icon-text-icon\" style=\"color:#333333;font-size:24px;width:24px;height:24px\"><i class=\"sui sui-photo\" style=\"font-size:24px;color:#333333\"><\/i><\/div>\n<div class=\"sue-icon-text-content su-u-trim\" style=\"color:#333333\">Displaying the default color in unsupported browsers.<\/div>\n<div style=\"clear:both;height:0\"><\/div>\n<\/div>\n<h2>Displaying the Color Value<\/h2>\n<p>Eliminate the need to use Photoshop for simple tasks like copying a <code>hex<\/code> color format. With HTML5, you can develop a straightforward tool that utilizes the <code>color<\/code> input type to display the selected color\u2019s hexadecimal value:<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/html5-form-input-type\/colorpicker-value.jpg\" alt=\"Displaying the Hexadecimal Color Value\" width=\"500\" height=\"150\"><\/figure>\n<p>To begin, assign the <code>id<\/code> \u201ccolorpicker\u201d to the input element and create an adjacent empty <code>div<\/code> with the <code>id<\/code> \u201chexcolor\u201d to show the color value.<\/p>\n<pre>\r\n &lt;input type=\"color\" id=\"colorpicker\" name=\"color\" value=\"#ff0000\"&gt; &lt;div id=\"hexcolor\"&gt;&lt;\/div&gt;\r\n<\/pre>\n<p>Ensure jQuery is included in the document\u2019s <code>head<\/code>. Next, capture the color value and the target <code>div<\/code> in variables:<\/p>\n<pre>\r\nvar color = $('#colorpicker').val();\r\nvar hexcolor = $('#hexcolor');\r\n<\/pre>\n<p>Display the initial color value in the <code>div<\/code>:<\/p>\n<pre>\r\nhexcolor.html(color);\r\n<\/pre>\n<p>Update the display when a new color is selected:<\/p>\n<pre>\r\n$('#colorpicker').on('change', function() {\r\n  hexcolor.html(this.value);\r\n});\r\n<\/pre>\n<p>Now, you can see this functionality in action through the provided demo:<\/p>\n<p><a href=\"https:\/\/hongkiat.github.io\/html5-form-input-type\/\" class=\"su-button su-button-style-flat\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:0px\" target=\"__blank\" rel=\"noopener nofollow\"><span style=\"color:#FFFFFF;padding:7px 20px;font-size:16px;line-height:24px;border-color:#6cadf4;border-radius:0px;text-shadow:none\"><i class=\"sui sui-external-link\" style=\"font-size:16px;color:#fff\"><\/i>  Colorpicker Demo <\/span><\/a><\/p>\n<h2>Utilizing the Range Input<\/h2>\n<p>The <code>range<\/code> input type introduces a slider for numerical selection within a defined range, similar to functionalities found in jQuery UI. This feature simplifies the process of selecting numbers by providing a user-friendly slider interface:<\/p>\n<pre>\r\n &lt;input type=\"range\"&gt;\r\n<\/pre>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/html5-form-input-type\/range.jpg\" alt=\"HTML5 Range Input Basic Implementation\" width=\"500\" height=\"116\"><\/figure>\n<p>To customize further, the slider\u2019s orientation can be adjusted to vertical using CSS:<\/p>\n<pre>\r\ninput[type=range] {\r\n  width: 20px;\r\n  height: 200px;\r\n  -webkit-appearance: slider-vertical;\r\n}\r\n<\/pre>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/html5-form-input-type\/range-vertical.jpg\" alt=\"Vertical Range Slider\" width=\"500\" height=\"280\"><\/figure>\n<p>Defining the range limits is also possible by specifying the <code>min<\/code> and <code>max<\/code> attributes. For example:<\/p>\n<pre>\r\n &lt;input type=\"range\" name=\"range\" min=\"0\" max=\"225\"&gt;\r\n<\/pre>\n<p>This configuration sets the minimum value at zero and the maximum at 225. Without explicit <code>min<\/code> and <code>max<\/code> values, browsers default to a range of 0 to 100.<\/p>\n<h2>Displaying Slider Values<\/h2>\n<p>A common challenge with the <code>range<\/code> input type is that the selected number or value isn\u2019t displayed by default in the browser. To overcome this, a small amount of JavaScript or jQuery can be used to reveal the slider\u2019s value to users:<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/html5-form-input-type\/range-value.jpg\" alt=\"Displaying the Range Slider Value\" width=\"500\" height=\"150\"><\/figure>\n<p>Begin by placing an empty <code>div<\/code> adjacent to the input element. Style this <code>div<\/code> to visually represent a display box for the slider value.<\/p>\n<pre>\r\n &lt;input type=\"range\" id=\"slider\" value=\"10\" name=\"range\"&gt; &lt;div id=\"output\"&gt;&lt;\/div&gt;\r\n<\/pre>\n<p>Implement the following JavaScript code to dynamically display the slider\u2019s value, updating it in real-time as the user adjusts the slider:<\/p>\n<pre>\r\n$(function(){\r\n  var slider = $('#slider');\r\n  var output = $('#output');\r\n  \r\n  output.html(slider.val()); \/\/ Display the default slider value\r\n  \r\n  slider.on('change', function(){\r\n    output.html(this.value); \/\/ Update the display upon value change\r\n  });\r\n});\r\n<\/pre>\n<p>This functionality enhances user interaction by making the selected value visible. Explore this feature in the demo link provided. Note: This demo is best viewed in Chrome, Opera, and Safari, as Firefox and Internet Explorer do not support the <code>range<\/code> input type currently.<\/p>\n<p><a href=\"https:\/\/hongkiat.github.io\/html5-form-input-type\/\" class=\"su-button su-button-style-flat\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:0px\" target=\"__blank\" rel=\"noopener nofollow\"><span style=\"color:#FFFFFF;padding:7px 20px;font-size:16px;line-height:24px;border-color:#6cadf4;border-radius:0px;text-shadow:none\"><i class=\"sui sui-external-link\" style=\"font-size:16px;color:#fff\"><\/i>  Range Slider Demo <\/span><\/a><\/p>\n<h2>Concluding Thoughts<\/h2>\n<p>HTML5 significantly simplifies web development by introducing a variety of new input types, making it easier for developers to create more interactive and user-friendly forms. However, it\u2019s important to remember that support for these features can be limited in older browsers. Thus, when incorporating advanced input types like <strong>Date, Color, and Range<\/strong>, proceed with caution to ensure broad compatibility.<\/p>\n<p>We hope this article has provided valuable insights into HTML5 forms, enhancing your understanding and application of these modern web technologies. Thank you for taking the time to read through our discussion, and we trust you found the information both informative and enjoyable.<\/p>\n<p><a href=\"https:\/\/hongkiat.github.io\/html5-form-input-type\/\" class=\"su-button su-button-style-flat\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:0px\" target=\"__blank\" rel=\"noopener nofollow\"><span style=\"color:#FFFFFF;padding:7px 20px;font-size:16px;line-height:24px;border-color:#6cadf4;border-radius:0px;text-shadow:none\"><i class=\"sui sui-external-link\" style=\"font-size:16px;color:#fff\"><\/i>  View demo <\/span><\/a>\n<a href=\"https:\/\/github.com\/hongkiat\/html5-form-input-type\/\" class=\"su-button su-button-style-flat\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:0px\" target=\"__blank\" rel=\"noopener nofollow\"><span style=\"color:#FFFFFF;padding:7px 20px;font-size:16px;line-height:24px;border-color:#6cadf4;border-radius:0px;text-shadow:none\"><i class=\"sui sui-external-link\" style=\"font-size:16px;color:#fff\"><\/i>  Download source code <\/span><\/a><\/p>\n<h2>Explore More on HTML Forms<\/h2>\n<p>For those interested in delving deeper into the world of HTML forms, here are several resources to expand your knowledge and skills:<\/p>\n<ul>\n<li><a href=\"https:\/\/dev.opera.com\/articles\/new-form-features-in-html5\/\" rel=\"noopener\" target=\"_blank\">New form features in HTML5<\/a> \u2013 Opera Dev<\/li>\n<li><a href=\"https:\/\/www.wufoo.com\/html5\/\" rel=\"noopener\" target=\"_blank\">The Current State of HTML5 Forms<\/a> \u2013 Wufoo<\/li>\n<li><a href=\"https:\/\/www.sitepoint.com\/the-html5-form-attribute\/\" rel=\"noopener nofollow\" target=\"_blank\">HTML5 Form Attributes<\/a> \u2013 SitePoint<\/li>\n<li><a href=\"https:\/\/caniuse.com\/forms\" rel=\"noopener\" target=\"_blank\">When can I use HTML5 forms?<\/a> \u2013 CanIUse.com<\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Forms are ubiquitous across websites, serving as critical tools for user interaction. From logging into platforms like Facebook, Twitter, and Google to tweeting and updating statuses on social networks, forms facilitate essential online engagements. This article highlights the pivotal role of forms in website interaction, emphasizing the evolution and significance of input types with the&hellip;<\/p>\n","protected":false},"author":113,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[352],"tags":[1312,506,2016],"topic":[4520],"class_list":["entry-content","is-maxi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v22.8 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>HTML5 Forms Input Types: Date, Color and Range<\/title>\n<meta name=\"description\" content=\"Forms are ubiquitous across websites, serving as critical tools for user interaction. From logging into platforms like Facebook, Twitter, and Google to\" \/>\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.hongkiat.com\/blog\/html5-form-input-type\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Exploring HTML5 Form Input Types: Date, Color, and Range\" \/>\n<meta property=\"og:description\" content=\"Forms are ubiquitous across websites, serving as critical tools for user interaction. From logging into platforms like Facebook, Twitter, and Google to\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/html5-form-input-type\/\" \/>\n<meta property=\"og:site_name\" content=\"Hongkiat\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hongkiatcom\" \/>\n<meta property=\"article:published_time\" content=\"2012-10-08T13:01:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-03T17:13:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/assets.hongkiat.com\/uploads\/html5-form-input-type\/datepicker-calendar.jpg\" \/>\n<meta name=\"author\" content=\"Thoriq Firdaus\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@tfirdaus\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Thoriq Firdaus\" \/>\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.hongkiat.com\\\/blog\\\/html5-form-input-type\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-form-input-type\\\/\"},\"author\":{\"name\":\"Thoriq Firdaus\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e7948c7a175d211496331e4b6ce55807\"},\"headline\":\"Exploring HTML5 Form Input Types: Date, Color, and Range\",\"datePublished\":\"2012-10-08T13:01:42+00:00\",\"dateModified\":\"2025-04-03T17:13:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-form-input-type\\\/\"},\"wordCount\":1135,\"commentCount\":17,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-form-input-type\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/html5-form-input-type\\\/datepicker-calendar.jpg\",\"keywords\":[\"Forms\",\"HTML\",\"HTML5 \\\/ CSS3 Tutorials\"],\"articleSection\":[\"Web Design\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-form-input-type\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-form-input-type\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-form-input-type\\\/\",\"name\":\"HTML5 Forms Input Types: Date, Color and Range\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-form-input-type\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-form-input-type\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/html5-form-input-type\\\/datepicker-calendar.jpg\",\"datePublished\":\"2012-10-08T13:01:42+00:00\",\"dateModified\":\"2025-04-03T17:13:02+00:00\",\"description\":\"Forms are ubiquitous across websites, serving as critical tools for user interaction. From logging into platforms like Facebook, Twitter, and Google to\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-form-input-type\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-form-input-type\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-form-input-type\\\/#primaryimage\",\"url\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/html5-form-input-type\\\/datepicker-calendar.jpg\",\"contentUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/html5-form-input-type\\\/datepicker-calendar.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-form-input-type\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Exploring HTML5 Form Input Types: Date, Color, and Range\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"name\":\"Hongkiat\",\"description\":\"Tech and Design Tips\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\",\"name\":\"Hongkiat.com\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"contentUrl\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"width\":1200,\"height\":799,\"caption\":\"Hongkiat.com\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/hongkiatcom\",\"https:\\\/\\\/x.com\\\/hongkiat\",\"https:\\\/\\\/www.pinterest.com\\\/hongkiat\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e7948c7a175d211496331e4b6ce55807\",\"name\":\"Thoriq Firdaus\",\"description\":\"Thoriq is a writer for Hongkiat.com with a passion for web design and development. He is the author of Responsive Web Design by Examples, where he covered his best approaches in developing responsive websites quickly with a framework.\",\"sameAs\":[\"https:\\\/\\\/thoriq.com\",\"https:\\\/\\\/x.com\\\/tfirdaus\"],\"jobTitle\":\"Web Developer\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/thoriq\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"HTML5 Forms Input Types: Date, Color and Range","description":"Forms are ubiquitous across websites, serving as critical tools for user interaction. From logging into platforms like Facebook, Twitter, and Google to","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.hongkiat.com\/blog\/html5-form-input-type\/","og_locale":"en_US","og_type":"article","og_title":"Exploring HTML5 Form Input Types: Date, Color, and Range","og_description":"Forms are ubiquitous across websites, serving as critical tools for user interaction. From logging into platforms like Facebook, Twitter, and Google to","og_url":"https:\/\/www.hongkiat.com\/blog\/html5-form-input-type\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2012-10-08T13:01:42+00:00","article_modified_time":"2025-04-03T17:13:02+00:00","og_image":[{"url":"https:\/\/assets.hongkiat.com\/uploads\/html5-form-input-type\/datepicker-calendar.jpg","type":"","width":"","height":""}],"author":"Thoriq Firdaus","twitter_card":"summary_large_image","twitter_creator":"@tfirdaus","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Thoriq Firdaus","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/html5-form-input-type\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/html5-form-input-type\/"},"author":{"name":"Thoriq Firdaus","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e7948c7a175d211496331e4b6ce55807"},"headline":"Exploring HTML5 Form Input Types: Date, Color, and Range","datePublished":"2012-10-08T13:01:42+00:00","dateModified":"2025-04-03T17:13:02+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/html5-form-input-type\/"},"wordCount":1135,"commentCount":17,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/html5-form-input-type\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/html5-form-input-type\/datepicker-calendar.jpg","keywords":["Forms","HTML","HTML5 \/ CSS3 Tutorials"],"articleSection":["Web Design"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hongkiat.com\/blog\/html5-form-input-type\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/html5-form-input-type\/","url":"https:\/\/www.hongkiat.com\/blog\/html5-form-input-type\/","name":"HTML5 Forms Input Types: Date, Color and Range","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/html5-form-input-type\/#primaryimage"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/html5-form-input-type\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/html5-form-input-type\/datepicker-calendar.jpg","datePublished":"2012-10-08T13:01:42+00:00","dateModified":"2025-04-03T17:13:02+00:00","description":"Forms are ubiquitous across websites, serving as critical tools for user interaction. From logging into platforms like Facebook, Twitter, and Google to","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/html5-form-input-type\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/html5-form-input-type\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/html5-form-input-type\/#primaryimage","url":"https:\/\/assets.hongkiat.com\/uploads\/html5-form-input-type\/datepicker-calendar.jpg","contentUrl":"https:\/\/assets.hongkiat.com\/uploads\/html5-form-input-type\/datepicker-calendar.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/html5-form-input-type\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Exploring HTML5 Form Input Types: Date, Color, and Range"}]},{"@type":"WebSite","@id":"https:\/\/www.hongkiat.com\/blog\/#website","url":"https:\/\/www.hongkiat.com\/blog\/","name":"Hongkiat","description":"Tech and Design Tips","publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hongkiat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hongkiat.com\/blog\/#organization","name":"Hongkiat.com","url":"https:\/\/www.hongkiat.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","contentUrl":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","width":1200,"height":799,"caption":"Hongkiat.com"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/hongkiatcom","https:\/\/x.com\/hongkiat","https:\/\/www.pinterest.com\/hongkiat\/"]},{"@type":"Person","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e7948c7a175d211496331e4b6ce55807","name":"Thoriq Firdaus","description":"Thoriq is a writer for Hongkiat.com with a passion for web design and development. He is the author of Responsive Web Design by Examples, where he covered his best approaches in developing responsive websites quickly with a framework.","sameAs":["https:\/\/thoriq.com","https:\/\/x.com\/tfirdaus"],"jobTitle":"Web Developer","url":"https:\/\/www.hongkiat.com\/blog\/author\/thoriq\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-3Wq","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/15154","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/users\/113"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=15154"}],"version-history":[{"count":4,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/15154\/revisions"}],"predecessor-version":[{"id":73547,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/15154\/revisions\/73547"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=15154"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=15154"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=15154"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=15154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}