{"id":6722,"date":"2024-01-10T17:47:00","date_gmt":"2024-01-10T17:47:00","guid":{"rendered":"https:\/\/codehim.com\/?p=6722"},"modified":"2024-01-22T15:48:34","modified_gmt":"2024-01-22T10:48:34","slug":"javascript-generate-random-background-color","status":"publish","type":"post","link":"https:\/\/codehim.com\/vanilla-javascript\/javascript-generate-random-background-color\/","title":{"rendered":"JavaScript Generate Random Background Color"},"content":{"rendered":"<p>This JavaScript code snippet helps you to create a simple tool to generate random background color with preview. It uses <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Global_Objects\/Math\/floor\" target=\"_blank\" rel=\"noopener\">Math.floor() function<\/a> to get a random value for HTML hex color code and set its value to preview div as background. Similarly, the generated color code display in a text input where users can easily copy the color code to clipboard.<\/p>\n<h2>How to Create JavaScript Generate Random Background Color<\/h2>\n<p>1. First of all, create the HTML structure as follows:<\/p>\n<pre class=\"prettyprint linenums lang-html\"> &lt;div class=\"wrapper\"&gt;\r\n    &lt;button id=\"gen\"&gt;Generate&lt;\/button&gt;\r\n    &lt;button id=\"clear\"&gt;Clear&lt;\/button&gt;\r\n    &lt;input id=\"randomNum\"&gt;\r\n    &lt;button id=\"copy\"&gt;Copy&lt;\/button&gt;\r\n    &lt;div id=\"copyCheck\"&gt;\r\n      &lt;i class=\"glyphicon glyphicon-ok\"&gt;&lt;\/i&gt;\r\n      &lt;span&gt;Color Code Copied&lt;\/span&gt;\r\n    &lt;\/div&gt;\r\n  &lt;\/div&gt;<\/pre>\n<p>2. After that, add the following CSS styles to your project:<\/p>\n<pre class=\"prettyprint linenums lang-css\">* {box-sizing: border-box;}\r\nbody {\r\n  position: relative;\r\n  background: #F1A9A0;\r\n}\r\n.wrapper {\r\n  margin: 200px auto 0;\r\n  width: 420px;\r\n}\r\nbutton {\r\n  width: 200px;\r\n  padding: 10px 20px;\r\n  background: #E74C3C;\r\n  border: none;\r\n  outline: none;\r\n  color: #fff;\r\n  font-size: 16px;\r\n  font-weight: 100;\r\n  transition: all 0.2s ease;\r\n}\r\nbutton:hover {background: #da493a;}\r\nbutton:active {background: #f7654b;}\r\nbutton:active, button:focus {outline: none;}\r\nbutton#copy {width: 80px; height: 50px; position: relative;}\r\ninput#randomNum {\r\n  width: 320px;\r\n  height: 50px;\r\n  outline: none;\r\n  line-height: 50px;\r\n  font-size: 14px;\r\n  border: none;\r\n  text-align: center;\r\n  margin-top: 20px;\r\n  color: #fff;\r\n  box-shadow: inset 0px 0px 200px 10px #446CB3;\r\n}\r\n#copyCheck {\r\n  position: fixed;\r\n  top: 10%;\r\n  right: -200px;\r\n  display: inline-block;\r\n  background: #353535;\r\n  padding: 10px 20px;\r\n  border-radius: 5px;\r\n  color: #fff;\r\n  box-shadow: 0px 3px 2px 0px rgba(0,0,0,0.32);\r\n  transition: all 0.3s ease; \r\n}\r\n#copyCheck i {\r\n  border-radius: 50%;\r\n  background: #2d8448;\r\n  padding: 10px;\r\n}<\/pre>\n<p>3. Finally, add the following JavaScript code and done.<\/p>\n<pre class=\"prettyprint linenums lang-js\">\/\/ Some Variables \r\nvar genButton = document.getElementById(\"gen\"), \/\/ Generate button\r\n    clear  = document.getElementById(\"clear\"),  \/\/ Clear button\r\n    output = document.getElementById(\"randomNum\"),  \/\/ Output space\r\n    copy = document.getElementById(\"copy\"),  \/\/ Copy to Clipboard Button\r\n    copyCheck = document.getElementById(\"copyCheck\");  \/\/ copy check\r\n  \r\n\r\n\/\/ Get Random Number Function &amp;&amp; make it the background of the body xD\r\nfunction getRandomNum() {\r\n    \"use strict\";\r\n    output.value = \"#\" + Math.floor((1e+5) + Math.random() * (9e+5)); \/\/ get random 6-digits number\r\n  var bgClr = output.value; \r\n  document.getElementById(\"preview\").style.backgroundColor = bgClr;  \/\/ set body bgColor to that random number\r\n}\r\n\/\/ Clear Random Number Function + make background of the body as default \r\nfunction clearNum() {\r\n    \"use strict\";\r\n    output.value = \"\";   \/\/ clear output space\r\n   document.getElementById(\"preview\").style.backgroundColor = \"#F1A9A0\";   \/\/ make bgColor of the body as default\r\n}\r\n\/\/ Copy the color code to the clipboard by clicking on \"Copy\" Button\r\nfunction copyToClipBoard() {\r\n  \"use strict\";\r\n  document.execCommand(\"copy\", false, output.select());\r\n  copyCheck.style.right = \"20px\";\r\n  showCheck = setTimeout(function() {\r\n    copyCheck.style.right = \"-200px\";\r\n  }, 3000);\r\n  clearTimeout(showCheck);\r\n}\r\n\/\/ Adding EventListener to the buttons\r\ngenButton.addEventListener(\"click\", getRandomNum);  \/\/ Generate Button\r\nclear.addEventListener(\"click\", clearNum);   \/\/ Clear Button\r\ncopy.addEventListener(\"click\", copyToClipBoard);\r\n\r\n\/\/---------------- Thanks for being here --------------------- \/\/<\/pre>\n<p>That&#8217;s all! hopefully, you have successfully integrated this random background color code snippet into your project. If you have any questions or facing any issues, feel free to comment below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This JavaScript code snippet helps you to create a simple tool to generate random background color with preview. It uses&#8230;<\/p>\n","protected":false},"author":1,"featured_media":6756,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[116],"tags":[],"class_list":["post-6722","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vanilla-javascript"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>JavaScript Generate Random Background Color &#8212; CodeHim<\/title>\n<meta name=\"description\" content=\"Here is a lightweight JavaScript code snippet to generate random background color. You can view demo and download source 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:\/\/codehim.com\/vanilla-javascript\/javascript-generate-random-background-color\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JavaScript Generate Random Background Color &#8212; CodeHim\" \/>\n<meta property=\"og:description\" content=\"Here is a lightweight JavaScript code snippet to generate random background color. You can view demo and download source code.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/codehim.com\/vanilla-javascript\/javascript-generate-random-background-color\/\" \/>\n<meta property=\"og:site_name\" content=\"CodeHim\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/codehimofficial\" \/>\n<meta property=\"article:published_time\" content=\"2024-01-10T17:47:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-22T10:48:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/codehim.com\/wp-content\/uploads\/2022\/05\/JavaScript-Generate-Random-.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"960\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Asif Mughal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@CodeHimOfficial\" \/>\n<meta name=\"twitter:site\" content=\"@CodeHimOfficial\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Asif Mughal\" \/>\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:\/\/codehim.com\/vanilla-javascript\/javascript-generate-random-background-color\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/javascript-generate-random-background-color\/\"},\"author\":{\"name\":\"Asif Mughal\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed\"},\"headline\":\"JavaScript Generate Random Background Color\",\"datePublished\":\"2024-01-10T17:47:00+00:00\",\"dateModified\":\"2024-01-22T10:48:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/javascript-generate-random-background-color\/\"},\"wordCount\":133,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/codehim.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/javascript-generate-random-background-color\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2022\/05\/JavaScript-Generate-Random-.png\",\"articleSection\":[\"Vanilla JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/codehim.com\/vanilla-javascript\/javascript-generate-random-background-color\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/javascript-generate-random-background-color\/\",\"url\":\"https:\/\/codehim.com\/vanilla-javascript\/javascript-generate-random-background-color\/\",\"name\":\"JavaScript Generate Random Background Color &#8212; CodeHim\",\"isPartOf\":{\"@id\":\"https:\/\/codehim.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/javascript-generate-random-background-color\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/javascript-generate-random-background-color\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2022\/05\/JavaScript-Generate-Random-.png\",\"datePublished\":\"2024-01-10T17:47:00+00:00\",\"dateModified\":\"2024-01-22T10:48:34+00:00\",\"description\":\"Here is a lightweight JavaScript code snippet to generate random background color. You can view demo and download source code.\",\"breadcrumb\":{\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/javascript-generate-random-background-color\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/codehim.com\/vanilla-javascript\/javascript-generate-random-background-color\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/javascript-generate-random-background-color\/#primaryimage\",\"url\":\"https:\/\/codehim.com\/wp-content\/uploads\/2022\/05\/JavaScript-Generate-Random-.png\",\"contentUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2022\/05\/JavaScript-Generate-Random-.png\",\"width\":1280,\"height\":960,\"caption\":\"JavaScript Generate Random Background Color\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/javascript-generate-random-background-color\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/codehim.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Vanilla JavaScript\",\"item\":\"https:\/\/codehim.com\/category\/vanilla-javascript\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"JavaScript Generate Random Background Color\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/codehim.com\/#website\",\"url\":\"https:\/\/codehim.com\/\",\"name\":\"CodeHim\",\"description\":\"Web Design Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/codehim.com\/#organization\"},\"alternateName\":\"Web Design Codes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/codehim.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/codehim.com\/#organization\",\"name\":\"CodeHim - Web Design Code & Scripts\",\"url\":\"https:\/\/codehim.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/codehim.com\/wp-content\/uploads\/2023\/06\/Codehim-short-logo.jpg\",\"contentUrl\":\"http:\/\/codehim.com\/wp-content\/uploads\/2023\/06\/Codehim-short-logo.jpg\",\"width\":280,\"height\":280,\"caption\":\"CodeHim - Web Design Code & Scripts\"},\"image\":{\"@id\":\"https:\/\/codehim.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/codehimofficial\",\"https:\/\/x.com\/CodeHimOfficial\",\"https:\/\/www.instagram.com\/codehim\/\",\"https:\/\/www.linkedin.com\/company\/codehim\",\"https:\/\/co.pinterest.com\/codehim\/\",\"https:\/\/www.youtube.com\/@codehim\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed\",\"name\":\"Asif Mughal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b25bfcd7d4e341c2c6f785a88d8ad2a4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b25bfcd7d4e341c2c6f785a88d8ad2a4?s=96&d=mm&r=g\",\"caption\":\"Asif Mughal\"},\"description\":\"I code and create web elements for amazing people around the world. I like work with new people. New people new Experiences. I truly enjoy what I'm doing, which makes me more passionate about web development and coding. I am always ready to do challenging tasks whether it is about creating a custom CMS from scratch or customizing an existing system.\",\"sameAs\":[\"https:\/\/codehim.com\"],\"url\":\"https:\/\/codehim.com\/author\/asif-mughal\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JavaScript Generate Random Background Color &#8212; CodeHim","description":"Here is a lightweight JavaScript code snippet to generate random background color. You can view demo and download source 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:\/\/codehim.com\/vanilla-javascript\/javascript-generate-random-background-color\/","og_locale":"en_US","og_type":"article","og_title":"JavaScript Generate Random Background Color &#8212; CodeHim","og_description":"Here is a lightweight JavaScript code snippet to generate random background color. You can view demo and download source code.","og_url":"https:\/\/codehim.com\/vanilla-javascript\/javascript-generate-random-background-color\/","og_site_name":"CodeHim","article_publisher":"https:\/\/www.facebook.com\/codehimofficial","article_published_time":"2024-01-10T17:47:00+00:00","article_modified_time":"2024-01-22T10:48:34+00:00","og_image":[{"width":1280,"height":960,"url":"https:\/\/codehim.com\/wp-content\/uploads\/2022\/05\/JavaScript-Generate-Random-.png","type":"image\/png"}],"author":"Asif Mughal","twitter_card":"summary_large_image","twitter_creator":"@CodeHimOfficial","twitter_site":"@CodeHimOfficial","twitter_misc":{"Written by":"Asif Mughal","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/codehim.com\/vanilla-javascript\/javascript-generate-random-background-color\/#article","isPartOf":{"@id":"https:\/\/codehim.com\/vanilla-javascript\/javascript-generate-random-background-color\/"},"author":{"name":"Asif Mughal","@id":"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed"},"headline":"JavaScript Generate Random Background Color","datePublished":"2024-01-10T17:47:00+00:00","dateModified":"2024-01-22T10:48:34+00:00","mainEntityOfPage":{"@id":"https:\/\/codehim.com\/vanilla-javascript\/javascript-generate-random-background-color\/"},"wordCount":133,"commentCount":0,"publisher":{"@id":"https:\/\/codehim.com\/#organization"},"image":{"@id":"https:\/\/codehim.com\/vanilla-javascript\/javascript-generate-random-background-color\/#primaryimage"},"thumbnailUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2022\/05\/JavaScript-Generate-Random-.png","articleSection":["Vanilla JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/codehim.com\/vanilla-javascript\/javascript-generate-random-background-color\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/codehim.com\/vanilla-javascript\/javascript-generate-random-background-color\/","url":"https:\/\/codehim.com\/vanilla-javascript\/javascript-generate-random-background-color\/","name":"JavaScript Generate Random Background Color &#8212; CodeHim","isPartOf":{"@id":"https:\/\/codehim.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/codehim.com\/vanilla-javascript\/javascript-generate-random-background-color\/#primaryimage"},"image":{"@id":"https:\/\/codehim.com\/vanilla-javascript\/javascript-generate-random-background-color\/#primaryimage"},"thumbnailUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2022\/05\/JavaScript-Generate-Random-.png","datePublished":"2024-01-10T17:47:00+00:00","dateModified":"2024-01-22T10:48:34+00:00","description":"Here is a lightweight JavaScript code snippet to generate random background color. You can view demo and download source code.","breadcrumb":{"@id":"https:\/\/codehim.com\/vanilla-javascript\/javascript-generate-random-background-color\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/codehim.com\/vanilla-javascript\/javascript-generate-random-background-color\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codehim.com\/vanilla-javascript\/javascript-generate-random-background-color\/#primaryimage","url":"https:\/\/codehim.com\/wp-content\/uploads\/2022\/05\/JavaScript-Generate-Random-.png","contentUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2022\/05\/JavaScript-Generate-Random-.png","width":1280,"height":960,"caption":"JavaScript Generate Random Background Color"},{"@type":"BreadcrumbList","@id":"https:\/\/codehim.com\/vanilla-javascript\/javascript-generate-random-background-color\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/codehim.com\/"},{"@type":"ListItem","position":2,"name":"Vanilla JavaScript","item":"https:\/\/codehim.com\/category\/vanilla-javascript\/"},{"@type":"ListItem","position":3,"name":"JavaScript Generate Random Background Color"}]},{"@type":"WebSite","@id":"https:\/\/codehim.com\/#website","url":"https:\/\/codehim.com\/","name":"CodeHim","description":"Web Design Code Snippets","publisher":{"@id":"https:\/\/codehim.com\/#organization"},"alternateName":"Web Design Codes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/codehim.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/codehim.com\/#organization","name":"CodeHim - Web Design Code & Scripts","url":"https:\/\/codehim.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codehim.com\/#\/schema\/logo\/image\/","url":"http:\/\/codehim.com\/wp-content\/uploads\/2023\/06\/Codehim-short-logo.jpg","contentUrl":"http:\/\/codehim.com\/wp-content\/uploads\/2023\/06\/Codehim-short-logo.jpg","width":280,"height":280,"caption":"CodeHim - Web Design Code & Scripts"},"image":{"@id":"https:\/\/codehim.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/codehimofficial","https:\/\/x.com\/CodeHimOfficial","https:\/\/www.instagram.com\/codehim\/","https:\/\/www.linkedin.com\/company\/codehim","https:\/\/co.pinterest.com\/codehim\/","https:\/\/www.youtube.com\/@codehim"]},{"@type":"Person","@id":"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed","name":"Asif Mughal","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codehim.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b25bfcd7d4e341c2c6f785a88d8ad2a4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b25bfcd7d4e341c2c6f785a88d8ad2a4?s=96&d=mm&r=g","caption":"Asif Mughal"},"description":"I code and create web elements for amazing people around the world. I like work with new people. New people new Experiences. I truly enjoy what I'm doing, which makes me more passionate about web development and coding. I am always ready to do challenging tasks whether it is about creating a custom CMS from scratch or customizing an existing system.","sameAs":["https:\/\/codehim.com"],"url":"https:\/\/codehim.com\/author\/asif-mughal\/"}]}},"views":3598,"_links":{"self":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts\/6722","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/comments?post=6722"}],"version-history":[{"count":0,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts\/6722\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/media\/6756"}],"wp:attachment":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/media?parent=6722"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/categories?post=6722"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/tags?post=6722"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}