{"id":24434,"date":"2015-08-06T21:01:50","date_gmt":"2015-08-06T13:01:50","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=24434"},"modified":"2025-04-24T17:02:10","modified_gmt":"2025-04-24T09:02:10","slug":"auto-highlight-text-user-click","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/auto-highlight-text-user-click\/","title":{"rendered":"How to Auto-Highlight Text Upon User Click"},"content":{"rendered":"<p>Some pieces of content on websites are meant to be copied by users, such as a URL address, an automatically generated API key, or a few lines of code (snippets). But copying these contents can be a challenge, particularly for users who are using a trackpad or a subpar mouse. So let\u2019s make it easier for them.<\/p>\n<p>If you have stumbled upon websites like <a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/thenextweb.com\/\">TheNextWeb<\/a>, you will find that the shortlink URL is highlighted when you click on it. Let\u2019s check out how this is done.<\/p>\n<h2>Getting Started<\/h2>\n<p>To begin with, we lay out the HTML that wraps the shortlink URL.<\/p>\n<pre>\n&lt;div class=\"shortlink\"&gt;\n  &lt;span class=\"shortlink__label\"&gt;Shortlink&lt;\/span&gt;\n  &lt;div class=\"shortlink__container\"&gt;\n    &lt;i class=\"shortlink__icon ion ion-link\"&gt;&lt;\/i&gt;\n    &lt;span class=\"shortlink__url\"&gt;http:\/\/goo.gl\/9JEpOz&lt;\/span&gt;\n  &lt;\/div&gt;\n&lt;\/div&gt;\n<\/pre>\n<p>We have the URL wrapped in a <code>span<\/code> element along with an icon from <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/ionic.io\/ionicons\">Ionicon<\/a>. The style of these elements is entirely up to you, as it will depend on your website layout. But, for the purpose of this demo, I style it this way:<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" alt=\"Shortlink component user interface\" height=\"380\" src=\"https:\/\/assets.hongkiat.com\/uploads\/auto-highlight-text-user-click\/shorlink.jpg\" width=\"700\"><\/figure>\n<p>It is simple, blue and square (grab <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/hongkiat.github.io\/selection-onclick\/css\/style.css\">the style codes here<\/a>).<\/p>\n<h2>The JavaScript<\/h2>\n<p>And here is the meat of the code, the JavaScript. The plan here is to <strong>highlight the URL as the users click on it<\/strong>.<\/p>\n<p>We begin the code with a variable that selects the element in which the user will click.<\/p>\n<pre>\nvar target = document.querySelector('.shortlink');\n<\/pre>\n<p>The <code>querySelector<\/code> is a JavaScript method to select the element; it basically works like the jQuery constructor <code>$()<\/code>. You can use the dot notation to get the element by the class or <code>#<\/code> notation to get an element by the ID.<\/p>\n<p>Next, we need to create a new JavaScript function.<\/p>\n<pre>\nfunction selection(elem) {\n\n}\n<\/pre>\n<p>We name our function as <code>selection()<\/code>. And as you can see above, the function requires a parameter to pass the element that wraps the URL or any regular text we would like to highlight. In our case, this would be the <code>span<\/code> element with the <code>shortlink__url<\/code> class.<\/p>\n<p>Within this function, we add a couple more variables:<\/p>\n<pre>\nvar target = document.querySelector('.shortlink');\n\nfunction selection(elem) {\n  var elem   = document.querySelector(elem);\n  var select = window.getSelection();\n  var range  = document.createRange();\n}\n<\/pre>\n<p>First, the <code>elem<\/code> variable selects the element that we pass through the parameter of the function. The second variable, <code>select<\/code>, runs a native JavaScript function to get the selection of text. The last variable, <code>range<\/code> controls the selection range; we would like to ensure that selection is only within the selected element.<\/p>\n<p>Next, we chain these variables with a couple of other JavaScript functions as follows:<\/p>\n<pre>\nvar target = document.querySelector('.shortlink');\n\nfunction selection(elem) {\n  var elem   = document.querySelector(elem);\n  var select = window.getSelection();\n  var range  = document.createRange();\n\n  range.selectNodeContents(elem);\n  select.addRange(range);\n}\n<\/pre>\n<p>The first addition, <code>range.selectNodeContents(elem)<\/code>, defines the <strong>range of the selection<\/strong> which in this case is the element referred to in <code>elem<\/code>. The last line, <code>select.addRange(range)<\/code> makes the selection limited to the range specified.<\/p>\n<p>Great! We are all set with the function. Let\u2019s put it into action.<\/p>\n<h2>Run It<\/h2>\n<p>We bind the target element with an <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/GlobalEventHandlers\/onclick\"><code>onclick<\/code> event<\/a>. As the element is clicked, we run the function we just made and pass the parameter with the class name of the element where the URL is wrapped; in this case it is <code>.shortlink__url<\/code>.<\/p>\n<pre>\ntarget.onclick = function() {\n  selection('.shortlink__url');\n};\n<\/pre>\n<p>We are done. As mentioned earlier, you can also do so for other types of content on your website which you might want your users to copy more easily.<\/p>\n<p>Some of you might be wondering if we could automatically <em>copy<\/em>, instead of just highlight, the short URL upon user click. While this may seem like a really good idea, it is unfortunately not quite easy to achieve and may cause a bad user experience. The copy action should be fully under the user\u2019s consent.<\/p>\n<p>The steps in this post only take it up to the highlight action. Whether our users would copy it or not is entirely up to them.<\/p>\n<p>You can follow through the following links to see the demo or download the source code.<\/p>\n<div class=\"button\">\n  <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/hongkiat.github.io\/selection-onclick\/\">View Demo<\/a>\n  <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/github.com\/hongkiat\/selection-onclick\/\">Download Source<\/a>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Some pieces of content on websites are meant to be copied by users, such as a URL address, an automatically generated API key, or a few lines of code (snippets). But copying these contents can be a challenge, particularly for users who are using a trackpad or a subpar mouse. So let\u2019s make it easier&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":[3395],"tags":[],"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>How to Auto-Highlight Text Upon User Click - Hongkiat<\/title>\n<meta name=\"description\" content=\"Some pieces of content on websites are meant to be copied by users, such as a URL address, an automatically generated API key, or a few lines of code\" \/>\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\/auto-highlight-text-user-click\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Auto-Highlight Text Upon User Click\" \/>\n<meta property=\"og:description\" content=\"Some pieces of content on websites are meant to be copied by users, such as a URL address, an automatically generated API key, or a few lines of code\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/auto-highlight-text-user-click\/\" \/>\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=\"2015-08-06T13:01:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-24T09:02:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/assets.hongkiat.com\/uploads\/auto-highlight-text-user-click\/shorlink.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\\\/auto-highlight-text-user-click\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/auto-highlight-text-user-click\\\/\"},\"author\":{\"name\":\"Thoriq Firdaus\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e7948c7a175d211496331e4b6ce55807\"},\"headline\":\"How to Auto-Highlight Text Upon User Click\",\"datePublished\":\"2015-08-06T13:01:50+00:00\",\"dateModified\":\"2025-04-24T09:02:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/auto-highlight-text-user-click\\\/\"},\"wordCount\":589,\"commentCount\":5,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/auto-highlight-text-user-click\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/auto-highlight-text-user-click\\\/shorlink.jpg\",\"articleSection\":[\"UI\\\/UX\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/auto-highlight-text-user-click\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/auto-highlight-text-user-click\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/auto-highlight-text-user-click\\\/\",\"name\":\"How to Auto-Highlight Text Upon User Click - Hongkiat\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/auto-highlight-text-user-click\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/auto-highlight-text-user-click\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/auto-highlight-text-user-click\\\/shorlink.jpg\",\"datePublished\":\"2015-08-06T13:01:50+00:00\",\"dateModified\":\"2025-04-24T09:02:10+00:00\",\"description\":\"Some pieces of content on websites are meant to be copied by users, such as a URL address, an automatically generated API key, or a few lines of code\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/auto-highlight-text-user-click\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/auto-highlight-text-user-click\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/auto-highlight-text-user-click\\\/#primaryimage\",\"url\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/auto-highlight-text-user-click\\\/shorlink.jpg\",\"contentUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/auto-highlight-text-user-click\\\/shorlink.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/auto-highlight-text-user-click\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Auto-Highlight Text Upon User Click\"}]},{\"@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 Auto-Highlight Text Upon User Click - Hongkiat","description":"Some pieces of content on websites are meant to be copied by users, such as a URL address, an automatically generated API key, or a few lines of code","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\/auto-highlight-text-user-click\/","og_locale":"en_US","og_type":"article","og_title":"How to Auto-Highlight Text Upon User Click","og_description":"Some pieces of content on websites are meant to be copied by users, such as a URL address, an automatically generated API key, or a few lines of code","og_url":"https:\/\/www.hongkiat.com\/blog\/auto-highlight-text-user-click\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2015-08-06T13:01:50+00:00","article_modified_time":"2025-04-24T09:02:10+00:00","og_image":[{"url":"https:\/\/assets.hongkiat.com\/uploads\/auto-highlight-text-user-click\/shorlink.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\/auto-highlight-text-user-click\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/auto-highlight-text-user-click\/"},"author":{"name":"Thoriq Firdaus","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e7948c7a175d211496331e4b6ce55807"},"headline":"How to Auto-Highlight Text Upon User Click","datePublished":"2015-08-06T13:01:50+00:00","dateModified":"2025-04-24T09:02:10+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/auto-highlight-text-user-click\/"},"wordCount":589,"commentCount":5,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/auto-highlight-text-user-click\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/auto-highlight-text-user-click\/shorlink.jpg","articleSection":["UI\/UX"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hongkiat.com\/blog\/auto-highlight-text-user-click\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/auto-highlight-text-user-click\/","url":"https:\/\/www.hongkiat.com\/blog\/auto-highlight-text-user-click\/","name":"How to Auto-Highlight Text Upon User Click - Hongkiat","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/auto-highlight-text-user-click\/#primaryimage"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/auto-highlight-text-user-click\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/auto-highlight-text-user-click\/shorlink.jpg","datePublished":"2015-08-06T13:01:50+00:00","dateModified":"2025-04-24T09:02:10+00:00","description":"Some pieces of content on websites are meant to be copied by users, such as a URL address, an automatically generated API key, or a few lines of code","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/auto-highlight-text-user-click\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/auto-highlight-text-user-click\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/auto-highlight-text-user-click\/#primaryimage","url":"https:\/\/assets.hongkiat.com\/uploads\/auto-highlight-text-user-click\/shorlink.jpg","contentUrl":"https:\/\/assets.hongkiat.com\/uploads\/auto-highlight-text-user-click\/shorlink.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/auto-highlight-text-user-click\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Auto-Highlight Text Upon User Click"}]},{"@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-6m6","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/24434","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=24434"}],"version-history":[{"count":4,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/24434\/revisions"}],"predecessor-version":[{"id":74086,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/24434\/revisions\/74086"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=24434"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=24434"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=24434"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=24434"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}