{"id":19093,"date":"2014-01-17T15:01:48","date_gmt":"2014-01-17T07:01:48","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=19093"},"modified":"2025-04-04T01:41:31","modified_gmt":"2025-04-03T17:41:31","slug":"html5-datalist-api","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/html5-datalist-api\/","title":{"rendered":"How to Dynamically Add and Remove HTML Classes with jQuery"},"content":{"rendered":"<p>Adding a new HTML class manually is straightforward; however, creating an interactive website requires the ability to <strong>modify, insert, and remove HTML classes dynamically.<\/strong> jQuery makes this easy. Below is an example demonstrating how to add and remove a class named <code>my-new-class<\/code> from a <code>&lt;div&gt;<\/code>.<\/p>\n<pre>\r\n\/\/ Add class\r\n$('div').addClass('my-new-class');\r\n\r\n\/\/ Remove class\r\n$('div').removeClass('my-new-class');\r\n<\/pre>\n<p>Beyond jQuery, you can also manage HTML classes using vanilla JavaScript:<\/p>\n<pre>\r\n\/\/ Add class\r\ndocument.getElementById('elem').className = 'my-new-class';\r\n\r\n\/\/ Remove class\r\ndocument.getElementById('elem').className = document.getElementsByTagName('div')[0].className.replace(\/(?:^|\\s)my-new-class(?!\\S)\/g, '');\r\n<\/pre>\n<p>Although direct JavaScript manipulation is less succinct than jQuery, it\u2019s a viable option for those preferring not to use a framework. Additionally, the modern <code>classList<\/code> API offers an even more convenient method for class manipulation.<\/p>\n<div class=\"ref-block ref-block--post\" id=\"ref-post-1\">\n\t\t\t\t\t<a href=\"https:\/\/www.hongkiat.com\/blog\/html5-geolocation\/\" class=\"ref-block__link\" title=\"Read More: How to Get User Location with HTML5 Geolocation API\" rel=\"bookmark\"><span class=\"screen-reader-text\">How to Get User Location with HTML5 Geolocation API<\/span><\/a>\n<div class=\"ref-block__thumbnail img-thumb img-thumb--jumbo\" data-img='{ \"src\" : \"https:\/\/assets.hongkiat.com\/uploads\/thumbs\/250x160\/html5-geolocation.jpg\" }'>\n\t\t\t\t\t\t\t<noscript>\n<style>.no-js #ref-block-post-17802 .ref-block__thumbnail { background-image: url(\"https:\/\/assets.hongkiat.com\/uploads\/thumbs\/250x160\/html5-geolocation.jpg\"); }<\/style>\n<\/noscript>\n\t\t\t\t\t\t<\/div>\n<div class=\"ref-block__summary\">\n<h4 class=\"ref-title\">How to Get User Location with HTML5 Geolocation API<\/h4>\n<p class=\"ref-description\">\n\t\t\t\t\t\tIn many cases, obtaining user location would be extremely useful to establish better user experience, for example: E-commerce...\t\t\t\t\t\t<span>Read more<\/span><\/p>\n<\/div>\n<\/div>\n<h2>Manipulating Classes with the classList API<\/h2>\n<p>The <code>classList<\/code> API, much like jQuery, provides methods for easy modification of HTML classes.<\/p>\n<p>For a <code>div<\/code> containing multiple classes, <code>classList<\/code> allows retrieval of all classes:<\/p>\n<pre>\r\nvar classes = document.getElementById('elem').classList;\r\nconsole.log(classes);\r\n<\/pre>\n<p>Accessing the browser Console will display the list of classes.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/html5-datalist-api\/console-classlist.jpg\" width=\"500\" height=\"151\" alt=\"Console showing classList output\"><\/figure>\n<p>To modify classes, utilize <code>.add()<\/code> and <code>.remove()<\/code> methods:<\/p>\n<pre>\r\nvar elem = document.getElementById('elem');\r\n\r\n\/\/ Add class\r\nelem.classList.add('my-new-class');\r\n\r\n\/\/ Remove class\r\nelem.classList.remove('my-new-class');\r\n<\/pre>\n<p>Adding multiple classes is straightforward, simply separate each class with a comma:<\/p>\n<pre>\r\nelem.classList.add('my-new-class', 'my-other-class');\r\n<\/pre>\n<p>To verify the presence of a specific class, <code>.contains()<\/code> returns <em>true<\/em> if found, and <em>false<\/em> otherwise:<\/p>\n<pre>\r\nelem.classList.contains('class-name');\r\n<\/pre>\n<p>Class toggling based on user interaction, such as a mouse click, is achieved with <code>.toggle()<\/code>:<\/p>\n<pre>\r\nvar button = document.getElementById('button');\r\nfunction toggle() {\r\n    elem.classList.toggle('bg');\r\n}\r\nbutton.addEventListener('click', toggle, false);\r\n<\/pre>\n<p>Explore the functionality through these links:<\/p>\n<p><a href=\"https:\/\/hongkiat.github.io\/html5-datalist-api\/\" 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>\n<a href=\"https:\/\/github.com\/hongkiat\/html5-datalist-api\/\" 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 codes <\/span><\/a><\/p>\n<h2>Concluding Thoughts<\/h2>\n<p>The <code>classList<\/code> API, a sleek addition with HTML5, simplifies class manipulation in modern browsers such as Firefox 3.6, Opera 11.5, Chrome 8, and Safari 5.1. However, it\u2019s not supported in Internet Explorer 9 and earlier. For compatibility in these cases, consider using <a href=\"https:\/\/gist.github.com\/termi\/3952026\" rel=\"nofollow noopener\" target=\"_blank\">Polyfills<\/a> to implement the classList API in Internet Explorer.<\/p>\n<h2>Additional Resources<\/h2>\n<ul>\n<li><a href=\"https:\/\/html5doctor.com\/the-classlist-api\/\" rel=\"nofollow noopener\" target=\"_blank\">The classList API<\/a> \u2014 HTML5 Doctor<\/li>\n<li><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Element.classList\" rel=\"nofollow noopener\" target=\"_blank\">Element classList<\/a> \u2014 MDN<\/li>\n<\/ul>\n<p><strong>Note:<\/strong> This post was first published on January 17, 2014.<\/p>","protected":false},"excerpt":{"rendered":"<p>Adding a new HTML class manually is straightforward; however, creating an interactive website requires the ability to modify, insert, and remove HTML classes dynamically. jQuery makes this easy. Below is an example demonstrating how to add and remove a class named my-new-class from a &lt;div&gt;. \/\/ Add class $(&#8216;div&#8217;).addClass(&#8216;my-new-class&#8217;); \/\/ Remove class $(&#8216;div&#8217;).removeClass(&#8216;my-new-class&#8217;); Beyond jQuery,&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":[911],"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.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Dynamically Add and Remove HTML Classes with jQuery - Hongkiat<\/title>\n<meta name=\"description\" content=\"Adding a new HTML class manually is straightforward; however, creating an interactive website requires the ability to modify, insert, and remove HTML\" \/>\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-datalist-api\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Dynamically Add and Remove HTML Classes with jQuery\" \/>\n<meta property=\"og:description\" content=\"Adding a new HTML class manually is straightforward; however, creating an interactive website requires the ability to modify, insert, and remove HTML\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/html5-datalist-api\/\" \/>\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=\"2014-01-17T07:01:48+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-03T17:41:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/assets.hongkiat.com\/uploads\/html5-datalist-api\/console-classlist.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=\"2 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-datalist-api\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-datalist-api\\\/\"},\"author\":{\"name\":\"Thoriq Firdaus\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e7948c7a175d211496331e4b6ce55807\"},\"headline\":\"How to Dynamically Add and Remove HTML Classes with jQuery\",\"datePublished\":\"2014-01-17T07:01:48+00:00\",\"dateModified\":\"2025-04-03T17:41:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-datalist-api\\\/\"},\"wordCount\":319,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-datalist-api\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/html5-datalist-api\\\/console-classlist.jpg\",\"keywords\":[\"jQuery\"],\"articleSection\":[\"Web Design\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-datalist-api\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-datalist-api\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-datalist-api\\\/\",\"name\":\"How to Dynamically Add and Remove HTML Classes with jQuery - Hongkiat\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-datalist-api\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-datalist-api\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/html5-datalist-api\\\/console-classlist.jpg\",\"datePublished\":\"2014-01-17T07:01:48+00:00\",\"dateModified\":\"2025-04-03T17:41:31+00:00\",\"description\":\"Adding a new HTML class manually is straightforward; however, creating an interactive website requires the ability to modify, insert, and remove HTML\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-datalist-api\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-datalist-api\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-datalist-api\\\/#primaryimage\",\"url\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/html5-datalist-api\\\/console-classlist.jpg\",\"contentUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/html5-datalist-api\\\/console-classlist.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-datalist-api\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Dynamically Add and Remove HTML Classes with jQuery\"}]},{\"@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":"How to Dynamically Add and Remove HTML Classes with jQuery - Hongkiat","description":"Adding a new HTML class manually is straightforward; however, creating an interactive website requires the ability to modify, insert, and remove HTML","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-datalist-api\/","og_locale":"en_US","og_type":"article","og_title":"How to Dynamically Add and Remove HTML Classes with jQuery","og_description":"Adding a new HTML class manually is straightforward; however, creating an interactive website requires the ability to modify, insert, and remove HTML","og_url":"https:\/\/www.hongkiat.com\/blog\/html5-datalist-api\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2014-01-17T07:01:48+00:00","article_modified_time":"2025-04-03T17:41:31+00:00","og_image":[{"url":"https:\/\/assets.hongkiat.com\/uploads\/html5-datalist-api\/console-classlist.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":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/html5-datalist-api\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/html5-datalist-api\/"},"author":{"name":"Thoriq Firdaus","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e7948c7a175d211496331e4b6ce55807"},"headline":"How to Dynamically Add and Remove HTML Classes with jQuery","datePublished":"2014-01-17T07:01:48+00:00","dateModified":"2025-04-03T17:41:31+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/html5-datalist-api\/"},"wordCount":319,"commentCount":4,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/html5-datalist-api\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/html5-datalist-api\/console-classlist.jpg","keywords":["jQuery"],"articleSection":["Web Design"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hongkiat.com\/blog\/html5-datalist-api\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/html5-datalist-api\/","url":"https:\/\/www.hongkiat.com\/blog\/html5-datalist-api\/","name":"How to Dynamically Add and Remove HTML Classes with jQuery - Hongkiat","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/html5-datalist-api\/#primaryimage"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/html5-datalist-api\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/html5-datalist-api\/console-classlist.jpg","datePublished":"2014-01-17T07:01:48+00:00","dateModified":"2025-04-03T17:41:31+00:00","description":"Adding a new HTML class manually is straightforward; however, creating an interactive website requires the ability to modify, insert, and remove HTML","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/html5-datalist-api\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/html5-datalist-api\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/html5-datalist-api\/#primaryimage","url":"https:\/\/assets.hongkiat.com\/uploads\/html5-datalist-api\/console-classlist.jpg","contentUrl":"https:\/\/assets.hongkiat.com\/uploads\/html5-datalist-api\/console-classlist.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/html5-datalist-api\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Dynamically Add and Remove HTML Classes with jQuery"}]},{"@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-4XX","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/19093","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=19093"}],"version-history":[{"count":3,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/19093\/revisions"}],"predecessor-version":[{"id":73652,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/19093\/revisions\/73652"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=19093"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=19093"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=19093"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=19093"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}