{"id":19817,"date":"2014-04-16T18:01:25","date_gmt":"2014-04-16T10:01:25","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=19817"},"modified":"2025-04-24T17:20:45","modified_gmt":"2025-04-24T09:20:45","slug":"html5-contextual-menu","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/html5-contextual-menu\/","title":{"rendered":"Add Contextual Menu on Your Website With HTML5"},"content":{"rendered":"<p>The contextual menu is the menu listed when you right-click on your computer screen. The menu usually <strong>comprises shortcuts<\/strong> for some of our <a href=\"https:\/\/www.hongkiat.com\/blog\/customize-new-send-to-windows\/\">favorite repeated actions<\/a> like creating or sorting folders\/files, opening a new application window, or accessing System Preferences to change an option.<\/p>\n<p>For years, the contextual menu has resided in native applications. Nowadays, the contextual menu brings tons of benefits to web apps, for example in <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/cpanel.net\/\">cPanel\u2019s File Manager<\/a> and <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/gmail.com\">Gmail<\/a>. These menus are built using extensive JavaScript.<\/p>\n<p>In the future, we may be able to <strong>build contextual menus for our websites using HTML5<\/strong>. Come check it out with me.<\/p>\n<p class=\"note\"><strong>Recommended Reading: <\/strong><a href=\"https:\/\/www.hongkiat.com\/blog\/customize-mac-right-click-menu\/\">Create Customize Shortcut In Mac\u2019s Right Click Menu [Guide]<\/a><\/p>\n<h2>Building a Contextual Menu<\/h2>\n<p>HTML5 has introduced two new elements, <code>menu<\/code> and <code>menuitem<\/code>, for you to build a contextual menu. For the browser to treat the <code>menu<\/code> element as a contextual menu, set the menu type to <code>context<\/code> and give it a unique ID.<\/p>\n<p>Below is an example where we create a contextual menu with two items.<\/p>\n<pre>\n&lt;menu type=\"context\" id=\"context-menu-id\"&gt;\n  &lt;menuitem&gt;Edit Content&lt;\/menuitem&gt;\n  &lt;menuitem&gt;Email Selection&lt;\/menuitem&gt;\n&lt;\/menu&gt;\n<\/pre>\n<p>It\u2019s also possible to add a sub-menu by nesting the <code>menu<\/code> element:<\/p>\n<pre>\n&lt;menu type=\"context\" id=\"context-menu-id\"&gt;\n  &lt;menuitem&gt;Edit Content&lt;\/menuitem&gt;\n  &lt;menuitem&gt;Email Selection&lt;\/menuitem&gt;\n  &lt;menu label=\"Share...\"&gt;\n    &lt;menuitem&gt;Facebook&lt;\/menuitem&gt;\n    &lt;menuitem&gt;Twitter&lt;\/menuitem&gt;\n  &lt;\/menu&gt;\n&lt;\/menu&gt;\n<\/pre>\n<p>For the contextual menu to appear on screen when right-clicking, use the new HTML attribute <code>contextmenu<\/code>. This attribute selects the menu with the specified ID. In our example, target the menu with <code>contextmenu=\"context-menu-id\"<\/code>.<\/p>\n<p>Assign the attribute to the <code>&lt;body&gt;<\/code> tag to use the contextual menu on the entire page. Alternatively, add it to a specific HTML element to use the menu exclusively within that element.<\/p>\n<p>The new contextual menu appears within the operating system menu, as shown below.<\/p>\n<figure><img decoding=\"async\" alt=\"HTML5 Contextual Menu Example\" src=\"https:\/\/assets.hongkiat.com\/uploads\/html5-contextual-menu\/menu.jpg\"><\/figure>\n<h2>Adding an Icon<\/h2>\n<p>Many of you have likely seen contextual menus with icons beside them. In some cases, an icon can be a great visual aid, <strong>helping users quickly understand the menu\u2019s purpose<\/strong>. Additionally, it gives users a clue about which application is associated with the new menus.<\/p>\n<figure><img decoding=\"async\" alt=\"Dropbox Contextual Menu Icon\" src=\"https:\/\/assets.hongkiat.com\/uploads\/html5-contextual-menu\/dropbox-menu.jpg\"><\/figure>\n<p>Add an icon to the HTML5 contextual menu using the <code>icon<\/code> attribute:<\/p>\n<pre>\n&lt;menu type=\"context\" id=\"context-menu-id\"&gt;\n  &lt;menuitem icon=\"img\/edit.png\"&gt;Edit Content&lt;\/menuitem&gt;\n  &lt;menuitem icon=\"img\/mail.png\"&gt;Email Selection&lt;\/menuitem&gt;\n  &lt;menu label=\"Share...\"&gt;\n    &lt;menuitem&gt;Facebook&lt;\/menuitem&gt;\n    &lt;menuitem&gt;Twitter&lt;\/menuitem&gt;\n  &lt;\/menu&gt;\n&lt;\/menu&gt;\n<\/pre>\n<p>Here\u2019s what it looks like in the browser.<\/p>\n<figure><img decoding=\"async\" alt=\"Contextual Menu with Icon\" src=\"https:\/\/assets.hongkiat.com\/uploads\/html5-contextual-menu\/menu-icin.jpg\"><\/figure>\n<h2>Make the menu functioning<\/h2>\n<p>At this point, the contextual menu doesn\u2019t do anything when clicked. However, making it functional with basic JavaScript is straightforward. In our example, the \u201cEmail Selection\u201d menu will **let users send highlighted text via their email application**.<\/p>\n<p>To implement this, let\u2019s add a function to grab the user\u2019s highlighted text.<\/p>\n<pre>\nfunction getSelectedText() {\n  var text = \"\";\n  if (window.getSelection) {\n    text = window.getSelection().toString();\n  } else if (document.selection && document.selection.type != 'Control') {\n    text = document.selection.createRange().text;\n  }\n  return text;\n};\n<\/pre>\n<p>Then, create another function, like `sendEmail()`, that opens the email application. The email subject will be pre-populated with the document title, and the email content with the user\u2019s selected text.<\/p>\n<pre>\nfunction sendEmail() {\n  var bodyText = getSelectedText();\n  window.location.href = 'mailto:?subject=' + document.title + '&body=' + bodyText + '';\n};\n<\/pre>\n<p>Finally, add the `onclick` attribute to the menu item to trigger this function on click.<\/p>\n<pre>\n&lt;menuitem icon=\"img\/mail.png\" onclick=\"sendEmail();\"&gt;Email Selection&lt;\/menuitem&gt;\n<\/pre>\n<p>Previously, we covered <a href=\"https:\/\/www.hongkiat.com\/blog\/html5-editable-content\/\">HTML5 EditableContent<\/a>, which allows editing web content directly from the front end. We can utilize this function by adding it to our \u201cEdit Content\u201d menu item.<\/p>\n<h2>Sidenote<\/h2>\n<p>I\u2019m excited about this new feature. I see many possibilities for what we can build with the HTML5 Contextual Menu. Unfortunately, at the time of writing, only Firefox implemented this feature. Hopefully, other browsers will catch up soon.<\/p>\n<p>See the demo below <strong>(Only works in Firefox)<\/strong>.<\/p>\n<div class=\"button\">\n    <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/hongkiat.github.io\/html5-contextual-menu\/\">View Demo<\/a>\n    <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/github.com\/hongkiat\/html5-contextual-menu\/\">Download Source<\/a>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>The contextual menu is the menu listed when you right-click on your computer screen. The menu usually comprises shortcuts for some of our favorite repeated actions like creating or sorting folders\/files, opening a new application window, or accessing System Preferences to change an option. For years, the contextual menu has resided in native applications. Nowadays,&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":[506,4102],"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.6) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Add Contextual Menu on Your Website With HTML5 - Hongkiat<\/title>\n<meta name=\"description\" content=\"The contextual menu is the menu listed when you right-click on your computer screen. The menu usually comprises shortcuts for some of our favorite\" \/>\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-contextual-menu\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Add Contextual Menu on Your Website With HTML5\" \/>\n<meta property=\"og:description\" content=\"The contextual menu is the menu listed when you right-click on your computer screen. The menu usually comprises shortcuts for some of our favorite\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/html5-contextual-menu\/\" \/>\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-04-16T10:01:25+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-24T09:20:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/assets.hongkiat.com\/uploads\/html5-contextual-menu\/menu.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=\"4 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-contextual-menu\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-contextual-menu\\\/\"},\"author\":{\"name\":\"Thoriq Firdaus\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e7948c7a175d211496331e4b6ce55807\"},\"headline\":\"Add Contextual Menu on Your Website With HTML5\",\"datePublished\":\"2014-04-16T10:01:25+00:00\",\"dateModified\":\"2025-04-24T09:20:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-contextual-menu\\\/\"},\"wordCount\":517,\"commentCount\":6,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-contextual-menu\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/html5-contextual-menu\\\/menu.jpg\",\"keywords\":[\"HTML\",\"Interface Design\"],\"articleSection\":[\"Web Design\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-contextual-menu\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-contextual-menu\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-contextual-menu\\\/\",\"name\":\"Add Contextual Menu on Your Website With HTML5 - Hongkiat\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-contextual-menu\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-contextual-menu\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/html5-contextual-menu\\\/menu.jpg\",\"datePublished\":\"2014-04-16T10:01:25+00:00\",\"dateModified\":\"2025-04-24T09:20:45+00:00\",\"description\":\"The contextual menu is the menu listed when you right-click on your computer screen. The menu usually comprises shortcuts for some of our favorite\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-contextual-menu\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-contextual-menu\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-contextual-menu\\\/#primaryimage\",\"url\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/html5-contextual-menu\\\/menu.jpg\",\"contentUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/html5-contextual-menu\\\/menu.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/html5-contextual-menu\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Add Contextual Menu on Your Website With HTML5\"}]},{\"@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":"Add Contextual Menu on Your Website With HTML5 - Hongkiat","description":"The contextual menu is the menu listed when you right-click on your computer screen. The menu usually comprises shortcuts for some of our favorite","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-contextual-menu\/","og_locale":"en_US","og_type":"article","og_title":"Add Contextual Menu on Your Website With HTML5","og_description":"The contextual menu is the menu listed when you right-click on your computer screen. The menu usually comprises shortcuts for some of our favorite","og_url":"https:\/\/www.hongkiat.com\/blog\/html5-contextual-menu\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2014-04-16T10:01:25+00:00","article_modified_time":"2025-04-24T09:20:45+00:00","og_image":[{"url":"https:\/\/assets.hongkiat.com\/uploads\/html5-contextual-menu\/menu.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":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/html5-contextual-menu\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/html5-contextual-menu\/"},"author":{"name":"Thoriq Firdaus","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e7948c7a175d211496331e4b6ce55807"},"headline":"Add Contextual Menu on Your Website With HTML5","datePublished":"2014-04-16T10:01:25+00:00","dateModified":"2025-04-24T09:20:45+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/html5-contextual-menu\/"},"wordCount":517,"commentCount":6,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/html5-contextual-menu\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/html5-contextual-menu\/menu.jpg","keywords":["HTML","Interface Design"],"articleSection":["Web Design"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hongkiat.com\/blog\/html5-contextual-menu\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/html5-contextual-menu\/","url":"https:\/\/www.hongkiat.com\/blog\/html5-contextual-menu\/","name":"Add Contextual Menu on Your Website With HTML5 - Hongkiat","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/html5-contextual-menu\/#primaryimage"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/html5-contextual-menu\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/html5-contextual-menu\/menu.jpg","datePublished":"2014-04-16T10:01:25+00:00","dateModified":"2025-04-24T09:20:45+00:00","description":"The contextual menu is the menu listed when you right-click on your computer screen. The menu usually comprises shortcuts for some of our favorite","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/html5-contextual-menu\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/html5-contextual-menu\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/html5-contextual-menu\/#primaryimage","url":"https:\/\/assets.hongkiat.com\/uploads\/html5-contextual-menu\/menu.jpg","contentUrl":"https:\/\/assets.hongkiat.com\/uploads\/html5-contextual-menu\/menu.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/html5-contextual-menu\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Add Contextual Menu on Your Website With HTML5"}]},{"@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-59D","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/19817","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=19817"}],"version-history":[{"count":4,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/19817\/revisions"}],"predecessor-version":[{"id":74127,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/19817\/revisions\/74127"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=19817"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=19817"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=19817"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=19817"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}