{"id":513,"date":"2020-12-18T18:43:00","date_gmt":"2020-12-18T16:43:00","guid":{"rendered":"https:\/\/html-online.com\/articles\/?p=513"},"modified":"2020-12-24T11:46:43","modified_gmt":"2020-12-24T09:46:43","slug":"getelementbyclass","status":"publish","type":"post","link":"https:\/\/html-online.com\/articles\/getelementbyclass\/","title":{"rendered":"getElementByClass JavaScript Function?"},"content":{"rendered":"<p>The&nbsp;<em>getElementById<\/em> is a very common <a href=\"https:\/\/html-css-js.com\/js\/\">JavaScript <\/a>function that returns a reference to the element by its ID, but unfortunately when we try to use <em>getElementByClass<\/em>, the console returns the following error: <strong>Uncaught TypeError: document.getElementByClass is not a function<\/strong>.<br \/>\n<!--more--><br \/>\nIn this article I&#8217;m going to present two workarounds to replace the getElementByClass JS function, with or without using jQuery.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-514\" src=\"https:\/\/html-online.com\/articles\/wp-content\/uploads\/2017\/12\/getElementByClass.jpg\" alt=\"getElementByClass javascript\" width=\"500\" height=\"375\" srcset=\"https:\/\/html-online.com\/articles\/wp-content\/uploads\/2017\/12\/getElementByClass.jpg 500w, https:\/\/html-online.com\/articles\/wp-content\/uploads\/2017\/12\/getElementByClass-300x225.jpg 300w\" sizes=\"auto, (max-width: 500px) 85vw, 500px\" \/><\/p>\n<h2>Using jQuery<\/h2>\n<p>You can use the <strong>$(&#8216;.testClass&#8217;)<\/strong>&nbsp;jQuery method&nbsp;to target elements by their class names if your project is using the <a href=\"https:\/\/htmlcheatsheet.com\/jquery\/\" target=\"_blank\" rel=\"noopener noreferrer\">jQuery library<\/a>.<br \/>\nHere&#8217;s an example which you can test in <a href=\"https:\/\/jsfiddle.net\/bbbh93uq\/\" target=\"_blank\" rel=\"noopener noreferrer\">this saved JSFiddle page<\/a>. Use this HTML code:<\/p>\n<div style=\"background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .2em .6em;\">\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #007700;\">&lt;div<\/span> <span style=\"color: #0000cc;\">class=<\/span><span style=\"background-color: #fff0f0;\">\"testClass\"<\/span><span style=\"color: #007700;\">&gt;<\/span>\n\tA div with class=\"testClass\".\n<span style=\"color: #007700;\">&lt;\/div&gt;<\/span>\n<span style=\"color: #007700;\">&lt;div<\/span> <span style=\"color: #0000cc;\">class=<\/span><span style=\"background-color: #fff0f0;\">\"testClass\"<\/span><span style=\"color: #007700;\">&gt;<\/span>\n\tThe second div with the same class name.\n<span style=\"color: #007700;\">&lt;\/div&gt;<\/span>\n<span style=\"color: #007700;\">&lt;p<\/span> <span style=\"color: #0000cc;\">class=<\/span><span style=\"background-color: #fff0f0;\">\"testClass\"<\/span><span style=\"color: #007700;\">&gt;<\/span>\n\tA paragraph with testClass\n<span style=\"color: #007700;\">&lt;\/p&gt;<\/span>\n<span style=\"color: #007700;\">&lt;button<\/span> <span style=\"color: #0000cc;\">type=<\/span><span style=\"background-color: #fff0f0;\">\"button\"<\/span><span style=\"color: #007700;\">&gt;<\/span>Click to toggle<span style=\"color: #007700;\">&lt;\/button&gt;<\/span>\n<\/pre>\n<\/div>\n<p>And attach this script:<\/p>\n<div style=\"background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .2em .6em;\">\n<pre style=\"margin: 0; line-height: 125%;\">$(<span style=\"background-color: #fff0f0;\">\"button\"<\/span>).click(<span style=\"color: #008800; font-weight: bold;\">function<\/span>(){\n    $(<span style=\"background-color: #fff0f0;\">'.testClass'<\/span>).toggle();\n});\n<\/pre>\n<\/div>\n<h2>Using Plain JavaScript<\/h2>\n<p>No worries if you don&#8217;t have jQuery included because we can use a function that is similar to the getElementsByClass: <strong>getElementsByClassName <\/strong>. This pure JS method returns an array of all elements in the document with the specified class name, as a NodeList object. Try it in <a href=\"https:\/\/jsfiddle.net\/bp7s6x31\/\" target=\"_blank\" rel=\"noopener noreferrer\">this JSFiddle<\/a>.<\/p>\n<p>Here&#8217;s the code and how to use it:<\/p>\n<div style=\"background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .2em .6em;\">\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #007700;\">&lt;div<\/span> <span style=\"color: #0000cc;\">class=<\/span><span style=\"background-color: #fff0f0;\">\"testClass\"<\/span><span style=\"color: #007700;\">&gt;<\/span>\n\tA div with class=\"testClass\".\n<span style=\"color: #007700;\">&lt;\/div&gt;<\/span>\n<span style=\"color: #007700;\">&lt;div<\/span> <span style=\"color: #0000cc;\">class=<\/span><span style=\"background-color: #fff0f0;\">\"testClass\"<\/span><span style=\"color: #007700;\">&gt;<\/span>\n\tThe second div with the same class name.\n<span style=\"color: #007700;\">&lt;\/div&gt;<\/span>\n<span style=\"color: #007700;\">&lt;p<\/span> <span style=\"color: #0000cc;\">class=<\/span><span style=\"background-color: #fff0f0;\">\"testClass\"<\/span><span style=\"color: #007700;\">&gt;<\/span>\n\tA paragraph with testClass\n<span style=\"color: #007700;\">&lt;\/p&gt;<\/span>\n\n<span style=\"color: #007700;\">&lt;button<\/span> <span style=\"color: #0000cc;\">onclick=<\/span><span style=\"background-color: #fff0f0;\">\"testFunction();\"<\/span><span style=\"color: #007700;\">&gt;<\/span>Alert the content of the first testClass<span style=\"color: #007700;\">&lt;\/button&gt;<\/span>\n\n<span style=\"color: #007700;\">&lt;script&gt;<\/span>\n<span style=\"color: #008800; font-weight: bold;\">function<\/span> testFunction() {\n    <span style=\"color: #008800; font-weight: bold;\">var<\/span> x <span style=\"color: #333333;\">=<\/span> <span style=\"color: #007020;\">document<\/span>.getElementsByClassName(<span style=\"background-color: #fff0f0;\">\"testClass\"<\/span>);\n    alert(x[<span style=\"color: #0000dd; font-weight: bold;\">0<\/span>].innerHTML);\n}\n<span style=\"color: #007700;\">&lt;\/script&gt;<\/span>\n<\/pre>\n<\/div>\n<p>This function is supported in all major browsers so you can go ahead and <a href=\"https:\/\/caniuse.com\/#search=getElementsByClassName\" target=\"_blank\" rel=\"noopener noreferrer\">use it<\/a> to target elements by their class names.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The&nbsp;getElementById is a very common JavaScript function that returns a reference to the element by its ID, but unfortunately when we try to use getElementByClass, the console returns the following error: Uncaught TypeError: document.getElementByClass is not a function.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,5,6],"tags":[],"class_list":["post-513","post","type-post","status-publish","format-standard","hentry","category-articles","category-javascript","category-jquery"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>getElementByClass JavaScript Function - Use it with or without jQuery<\/title>\n<meta name=\"description\" content=\"The getElementById is a common JavaScript function that returns a reference to the element by its ID, but when we try to use getElementByClass,\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/html-online.com\/articles\/getelementbyclass\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"getElementByClass JavaScript Function - Use it with or without jQuery\" \/>\n<meta property=\"og:description\" content=\"The getElementById is a common JavaScript function that returns a reference to the element by its ID, but when we try to use getElementByClass,\" \/>\n<meta property=\"og:url\" content=\"https:\/\/html-online.com\/articles\/getelementbyclass\/\" \/>\n<meta property=\"og:site_name\" content=\"HTML Online\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/htmlcoding\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-12-18T16:43:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-12-24T09:46:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/html-online.com\/articles\/wp-content\/uploads\/2017\/12\/getElementByClass.jpg\" \/>\n<meta name=\"author\" content=\"HTML Editor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"HTML Editor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated 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:\/\/html-online.com\/articles\/getelementbyclass\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/html-online.com\/articles\/getelementbyclass\/\"},\"author\":{\"name\":\"HTML Editor\",\"@id\":\"https:\/\/html-online.com\/articles\/#\/schema\/person\/019f9afa07f209153df0fecfc90b8c1d\"},\"headline\":\"getElementByClass JavaScript Function?\",\"datePublished\":\"2020-12-18T16:43:00+00:00\",\"dateModified\":\"2020-12-24T09:46:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/html-online.com\/articles\/getelementbyclass\/\"},\"wordCount\":196,\"publisher\":{\"@id\":\"https:\/\/html-online.com\/articles\/#organization\"},\"image\":{\"@id\":\"https:\/\/html-online.com\/articles\/getelementbyclass\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/html-online.com\/articles\/wp-content\/uploads\/2017\/12\/getElementByClass.jpg\",\"articleSection\":[\"Articles\",\"JavaScript\",\"jQuery\"],\"inLanguage\":\"en-GB\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/html-online.com\/articles\/getelementbyclass\/\",\"url\":\"https:\/\/html-online.com\/articles\/getelementbyclass\/\",\"name\":\"getElementByClass JavaScript Function - Use it with or without jQuery\",\"isPartOf\":{\"@id\":\"https:\/\/html-online.com\/articles\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/html-online.com\/articles\/getelementbyclass\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/html-online.com\/articles\/getelementbyclass\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/html-online.com\/articles\/wp-content\/uploads\/2017\/12\/getElementByClass.jpg\",\"datePublished\":\"2020-12-18T16:43:00+00:00\",\"dateModified\":\"2020-12-24T09:46:43+00:00\",\"description\":\"The getElementById is a common JavaScript function that returns a reference to the element by its ID, but when we try to use getElementByClass,\",\"breadcrumb\":{\"@id\":\"https:\/\/html-online.com\/articles\/getelementbyclass\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/html-online.com\/articles\/getelementbyclass\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/html-online.com\/articles\/getelementbyclass\/#primaryimage\",\"url\":\"https:\/\/html-online.com\/articles\/wp-content\/uploads\/2017\/12\/getElementByClass.jpg\",\"contentUrl\":\"https:\/\/html-online.com\/articles\/wp-content\/uploads\/2017\/12\/getElementByClass.jpg\",\"width\":500,\"height\":375,\"caption\":\"getElementByClass javascript\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/html-online.com\/articles\/getelementbyclass\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/html-online.com\/articles\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"getElementByClass JavaScript Function?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/html-online.com\/articles\/#website\",\"url\":\"https:\/\/html-online.com\/articles\/\",\"name\":\"HTML Online Articles\",\"description\":\"Tips, tricks, tutorials\u2026\",\"publisher\":{\"@id\":\"https:\/\/html-online.com\/articles\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/html-online.com\/articles\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/html-online.com\/articles\/#organization\",\"name\":\"HTML Online\",\"url\":\"https:\/\/html-online.com\/articles\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/html-online.com\/articles\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/html-online.com\/articles\/wp-content\/uploads\/2022\/06\/logo.jpg\",\"contentUrl\":\"https:\/\/html-online.com\/articles\/wp-content\/uploads\/2022\/06\/logo.jpg\",\"width\":350,\"height\":350,\"caption\":\"HTML Online\"},\"image\":{\"@id\":\"https:\/\/html-online.com\/articles\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/htmlcoding\/\",\"https:\/\/www.linkedin.com\/in\/ferencdenes\/\",\"https:\/\/www.youtube.com\/channel\/UCn38Jw1sJzbjVHO95Zp0Sww\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/html-online.com\/articles\/#\/schema\/person\/019f9afa07f209153df0fecfc90b8c1d\",\"name\":\"HTML Editor\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/html-online.com\/articles\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/7c1d8f5e7f1dc3e261766a96ac50c6a907fa5c236e87ab73379c57c9114e92cd?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/7c1d8f5e7f1dc3e261766a96ac50c6a907fa5c236e87ab73379c57c9114e92cd?s=96&d=mm&r=g\",\"caption\":\"HTML Editor\"},\"description\":\"In 2013, while wrestling with a mountain of client articles and an uncooperative CMS, I decided enough was enough. So, I created an online HTML editor purely out of necessity (and mild frustration). What began as a tool for my own sanity quickly evolved into a gift for the world\u2014or at least for anyone trying to avoid breaking their website's code. Since then, I've shared my tech notes on my blog, which serves as both a handy reference and a digital diary of the adventures and misadventures of a coder.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/ferencdenes\/\",\"https:\/\/www.youtube.com\/@htmlg\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"getElementByClass JavaScript Function - Use it with or without jQuery","description":"The getElementById is a common JavaScript function that returns a reference to the element by its ID, but when we try to use getElementByClass,","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:\/\/html-online.com\/articles\/getelementbyclass\/","og_locale":"en_GB","og_type":"article","og_title":"getElementByClass JavaScript Function - Use it with or without jQuery","og_description":"The getElementById is a common JavaScript function that returns a reference to the element by its ID, but when we try to use getElementByClass,","og_url":"https:\/\/html-online.com\/articles\/getelementbyclass\/","og_site_name":"HTML Online","article_publisher":"https:\/\/www.facebook.com\/htmlcoding\/","article_published_time":"2020-12-18T16:43:00+00:00","article_modified_time":"2020-12-24T09:46:43+00:00","og_image":[{"url":"https:\/\/html-online.com\/articles\/wp-content\/uploads\/2017\/12\/getElementByClass.jpg","type":"","width":"","height":""}],"author":"HTML Editor","twitter_card":"summary_large_image","twitter_misc":{"Written by":"HTML Editor","Estimated reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/html-online.com\/articles\/getelementbyclass\/#article","isPartOf":{"@id":"https:\/\/html-online.com\/articles\/getelementbyclass\/"},"author":{"name":"HTML Editor","@id":"https:\/\/html-online.com\/articles\/#\/schema\/person\/019f9afa07f209153df0fecfc90b8c1d"},"headline":"getElementByClass JavaScript Function?","datePublished":"2020-12-18T16:43:00+00:00","dateModified":"2020-12-24T09:46:43+00:00","mainEntityOfPage":{"@id":"https:\/\/html-online.com\/articles\/getelementbyclass\/"},"wordCount":196,"publisher":{"@id":"https:\/\/html-online.com\/articles\/#organization"},"image":{"@id":"https:\/\/html-online.com\/articles\/getelementbyclass\/#primaryimage"},"thumbnailUrl":"https:\/\/html-online.com\/articles\/wp-content\/uploads\/2017\/12\/getElementByClass.jpg","articleSection":["Articles","JavaScript","jQuery"],"inLanguage":"en-GB"},{"@type":"WebPage","@id":"https:\/\/html-online.com\/articles\/getelementbyclass\/","url":"https:\/\/html-online.com\/articles\/getelementbyclass\/","name":"getElementByClass JavaScript Function - Use it with or without jQuery","isPartOf":{"@id":"https:\/\/html-online.com\/articles\/#website"},"primaryImageOfPage":{"@id":"https:\/\/html-online.com\/articles\/getelementbyclass\/#primaryimage"},"image":{"@id":"https:\/\/html-online.com\/articles\/getelementbyclass\/#primaryimage"},"thumbnailUrl":"https:\/\/html-online.com\/articles\/wp-content\/uploads\/2017\/12\/getElementByClass.jpg","datePublished":"2020-12-18T16:43:00+00:00","dateModified":"2020-12-24T09:46:43+00:00","description":"The getElementById is a common JavaScript function that returns a reference to the element by its ID, but when we try to use getElementByClass,","breadcrumb":{"@id":"https:\/\/html-online.com\/articles\/getelementbyclass\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/html-online.com\/articles\/getelementbyclass\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/html-online.com\/articles\/getelementbyclass\/#primaryimage","url":"https:\/\/html-online.com\/articles\/wp-content\/uploads\/2017\/12\/getElementByClass.jpg","contentUrl":"https:\/\/html-online.com\/articles\/wp-content\/uploads\/2017\/12\/getElementByClass.jpg","width":500,"height":375,"caption":"getElementByClass javascript"},{"@type":"BreadcrumbList","@id":"https:\/\/html-online.com\/articles\/getelementbyclass\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/html-online.com\/articles\/"},{"@type":"ListItem","position":2,"name":"getElementByClass JavaScript Function?"}]},{"@type":"WebSite","@id":"https:\/\/html-online.com\/articles\/#website","url":"https:\/\/html-online.com\/articles\/","name":"HTML Online Articles","description":"Tips, tricks, tutorials\u2026","publisher":{"@id":"https:\/\/html-online.com\/articles\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/html-online.com\/articles\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/html-online.com\/articles\/#organization","name":"HTML Online","url":"https:\/\/html-online.com\/articles\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/html-online.com\/articles\/#\/schema\/logo\/image\/","url":"https:\/\/html-online.com\/articles\/wp-content\/uploads\/2022\/06\/logo.jpg","contentUrl":"https:\/\/html-online.com\/articles\/wp-content\/uploads\/2022\/06\/logo.jpg","width":350,"height":350,"caption":"HTML Online"},"image":{"@id":"https:\/\/html-online.com\/articles\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/htmlcoding\/","https:\/\/www.linkedin.com\/in\/ferencdenes\/","https:\/\/www.youtube.com\/channel\/UCn38Jw1sJzbjVHO95Zp0Sww"]},{"@type":"Person","@id":"https:\/\/html-online.com\/articles\/#\/schema\/person\/019f9afa07f209153df0fecfc90b8c1d","name":"HTML Editor","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/html-online.com\/articles\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/7c1d8f5e7f1dc3e261766a96ac50c6a907fa5c236e87ab73379c57c9114e92cd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7c1d8f5e7f1dc3e261766a96ac50c6a907fa5c236e87ab73379c57c9114e92cd?s=96&d=mm&r=g","caption":"HTML Editor"},"description":"In 2013, while wrestling with a mountain of client articles and an uncooperative CMS, I decided enough was enough. So, I created an online HTML editor purely out of necessity (and mild frustration). What began as a tool for my own sanity quickly evolved into a gift for the world\u2014or at least for anyone trying to avoid breaking their website's code. Since then, I've shared my tech notes on my blog, which serves as both a handy reference and a digital diary of the adventures and misadventures of a coder.","sameAs":["https:\/\/www.linkedin.com\/in\/ferencdenes\/","https:\/\/www.youtube.com\/@htmlg"]}]}},"_links":{"self":[{"href":"https:\/\/html-online.com\/articles\/wp-json\/wp\/v2\/posts\/513","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/html-online.com\/articles\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/html-online.com\/articles\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/html-online.com\/articles\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/html-online.com\/articles\/wp-json\/wp\/v2\/comments?post=513"}],"version-history":[{"count":5,"href":"https:\/\/html-online.com\/articles\/wp-json\/wp\/v2\/posts\/513\/revisions"}],"predecessor-version":[{"id":1168,"href":"https:\/\/html-online.com\/articles\/wp-json\/wp\/v2\/posts\/513\/revisions\/1168"}],"wp:attachment":[{"href":"https:\/\/html-online.com\/articles\/wp-json\/wp\/v2\/media?parent=513"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/html-online.com\/articles\/wp-json\/wp\/v2\/categories?post=513"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/html-online.com\/articles\/wp-json\/wp\/v2\/tags?post=513"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}