{"id":9520,"date":"2024-01-09T18:03:00","date_gmt":"2024-01-09T18:03:00","guid":{"rendered":"https:\/\/codehim.com\/?p=9520"},"modified":"2024-01-22T16:05:07","modified_gmt":"2024-01-22T11:05:07","slug":"javascript-search-in-array-of-objects","status":"publish","type":"post","link":"https:\/\/codehim.com\/text-input\/javascript-search-in-array-of-objects\/","title":{"rendered":"JavaScript Search in Array Of Objects"},"content":{"rendered":"<p>This JavaScript code performs live searches in an array of objects retrieved from a JSON file. The code enables users to input text in a search field, dynamically displaying city or state matches that correspond to the input. It uses <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Guide\/Regular_expressions\" target=\"_blank\" rel=\"noopener\">regular expressions<\/a> to filter the matching text in the list and <a href=\"https:\/\/codehim.com\/text-input\/javascript-search-text-on-page-and-highlight\/\" target=\"_blank\" rel=\"noopener\">highlights the user&#8217;s search<\/a> input within the results.<\/p>\n<p>The purpose is to assist users in finding words from a dataset of longer text, providing a smooth search experience. The code simplifies the integration of live search features.<\/p>\n<h2>How to Create Search In Array Of Objects in JavaScript<\/h2>\n<p>1. Start by creating an HTML structure. Define an input field for users to enter their search queries and a container for displaying the search results. You can use the following HTML template:<\/p>\n<pre class=\"prettyprint linenums lang-html\">&lt;form id=\"search-form\"&gt;\r\n       &lt;input id=\"search\" type=\"text\" placeholder=\"Search for cities or states\" \/&gt;\r\n   &lt;\/form&gt;\r\n   &lt;h6&gt;&lt;\/h6&gt;\r\n   &lt;ul id=\"search-results\"&gt;\r\n       \r\n   &lt;\/ul&gt;\r\n<\/pre>\n<p>2. Use CSS to <a href=\"https:\/\/codehim.com\/text-input\/stylish-search-box-in-html-css-code\/\" target=\"_blank\" rel=\"noopener\">style the search input<\/a>, results container, and the overall layout. The following CSS code contains styling instructions to create a clean and user-friendly interface.<\/p>\n<pre class=\"prettyprint linenums lang-css\">* {\r\n    box-sizing: border-box;\r\n    margin: 0;\r\n    padding: 0;\r\n    color: #636360;\r\n    font-size: 16px;\r\n    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;\r\n}\r\n\r\nbody {\r\n    background-color: #BDBAA4;\r\n}\r\n#search-form {\r\n    width: 95%;\r\n    margin: 2em auto;\r\n    transition: .5s;\r\n}\r\ninput {\r\n    width: 100%;\r\n    background-color: #E3E5D5;\r\n    color: #636360;\r\n    border: none;\r\n    font-size: 16px;\r\n    padding: 1em .5em;\r\n    outline: none;\r\n    border-radius: .3em;\r\n    -webkit-box-shadow: 0px 2px 2px 0px rgba(99,99,96,0.66);\r\n    -moz-box-shadow: 0px 2px 2px 0px rgba(99,99,96,0.66);\r\n    box-shadow: 0px 2px 2px 0px rgba(99,99,96,0.66);\r\n    transition: .6s;\r\n}\r\ninput:focus {\r\n    background-color: #EFEFE8;\r\n}\r\ninput::-webkit-input-placeholder {\r\n    color: #BDBAA4;\r\n}\r\ninput::-moz-placeholder {\r\n    color: #BDBAA4;\r\n}\r\ninput:-moz-placeholder {\r\n    color: #BDBAA4;\r\n}\r\ninput:-ms-input-placeholder {\r\n    color: #BDBAA4;\r\n}\r\n#search-results {\r\n    width: 95%;\r\n    margin: 2em auto;\r\n    border-top: 1px solid #E3E5D5;\r\n    transition: .5s;\r\n}\r\nh6 {\r\n    text-align: center;\r\n}\r\n.input {\r\n    font-style: oblique;\r\n    font-weight: 400;\r\n}\r\nli {\r\n    padding: 1em .3em;\r\n    list-style: none;\r\n    border-bottom: 1px solid #E3E5D5;\r\n    text-transform: capitalize;\r\n}\r\n.city {\r\n    font-weight: 700;\r\n}\r\n.population {\r\n    float: right;\r\n    font-size: .7em;\r\n    line-height: 1.8em;\r\n    text-transform: lowercase;\r\n}\r\n.highlight {\r\n    background-color: #E3E5D5;\r\n}\r\n@media screen and (min-width: 480px) {\r\n    #search-form {\r\n        width: 80%;\r\n    }\r\n    #search-results {\r\n        width: 80%;\r\n    }\r\n}\r\n@media screen and (min-width: 600px) {\r\n    * {\r\n        font-size: 20px;\r\n    }\r\n    input {\r\n        font-size: 20px;\r\n    }\r\n}\r\n@media screen and (min-width: 800px) {\r\n    #search-form {\r\n        width: 60%;\r\n    }\r\n    #search-results {\r\n        width: 60%;\r\n    }\r\n}\r\n@media screen and (min-width: 1024px) {\r\n    #search-form {\r\n        width: 500px;\r\n    }\r\n    #search-results {\r\n        width: 500px;\r\n    }\r\n}<\/pre>\n<p>3. In the JavaScript section, we start by fetching the data. The dataset of cities and states is retrieved from a remote source. You can specify your data source URL in the <code>endpoint<\/code> variable.<\/p>\n<pre class=\"prettyprint linenums lang-js\">const endpoint = 'https:\/\/gist.githubusercontent.com\/Miserlou\/c5cd8364bf9b2420bb29\/raw\/2bf258763cdddd704f8ffd3ea9a3e81d25e2c6f6\/cities.json'; \/\/Array of objects\r\nconst cities = [];\r\nfetch(endpoint) \/\/zaciagamy dane z linka\r\n    .then(blob =&gt; blob.json()) \/\/m\u00f3wimy, \u017ce jest to plik json\r\n    .then(data =&gt; cities.push(...data)) \/\/wpychamy do tablicy cities jako osobne elementy dlatego s\u0105 ...\r\n    .then(all =&gt; displayMatches());\r\nfunction findMatches(input) {\r\n    return cities.filter(place =&gt; {\r\n        const regex = new RegExp(input, 'gi') \/\/tworzymy wyra\u017cenie regularne kt\u00f3rym jest nasz input, czyli to co wpisze szukaj\u0105cy  drugi to:  g - global czyli globalny, i - insensitive (czyli nie zwraca uwagi na wielko\u015b\u0107 liter)\r\n        return place.city.match(regex) || place.state.match(regex); \/\/zwracamy tablic\u0119 pasuj\u0105ych do naszego wyra\u017cenia miast lub stan\u00f3w\r\n    });\r\n}\r\nfunction numberWithCommas(a) {\r\n    return a.toString().replace(\/\\B(?=(\\d{3})+(?!\\d))\/g, ',');\r\n  }\r\nfunction displayMatches() {\r\n    const input = searchInput.value;\r\n    const matchArray = findMatches(input);\r\n    const htmlMatchArray = matchArray.map(place =&gt; {\r\n        const regex = new RegExp(input, 'gi');\r\n        const cityName = place.city.replace(regex, `&lt;span class=\"highlight\"&gt;${input}&lt;\/span&gt;`);\r\n        const stateName = place.state.replace(regex, `&lt;span class=\"highlight\"&gt;${input}&lt;\/span&gt;`);\r\n        return `&lt;li&gt;\r\n                    &lt;p class=\"city-state\"&gt;&lt;span class=\"city\"&gt;${cityName},&lt;\/span&gt; ${stateName} &lt;span class=\"population\"&gt;population: ${numberWithCommas(place.population)} &lt;\/span&gt; &lt;\/p&gt;\r\n                &lt;\/li&gt;`;\r\n    }).join('');\r\n    const headerText = input ? `${matchArray.length} matches for &lt;span class=\"input\"&gt;${input}&lt;span&gt;` : `List of 1000 cities in the USA`;\r\n    searchResults.innerHTML = htmlMatchArray;\r\n    header.innerHTML = headerText;\r\n}\r\n\r\nconst searchInput = document.querySelector('#search');\r\nconst searchResults = document.querySelector('#search-results');\r\nconst header = document.querySelector('h6');\r\n\r\nsearchInput.addEventListener('change', displayMatches);\r\nsearchInput.addEventListener('keyup', displayMatches);<\/pre>\n<p>That&#8217;s all! hopefully, you have successfully created a feature to search in array of objects using JavaScript. This user-friendly feature improves user engagement and navigation, making it a valuable addition to your project. If you have any questions or suggestions, feel free to comment below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This JavaScript code performs live searches in an array of objects retrieved from a JSON file. The code enables users&#8230;<\/p>\n","protected":false},"author":1,"featured_media":9535,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[97],"tags":[150],"class_list":["post-9520","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-text-input","tag-search-box"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>JavaScript Search in Array Of Objects &#8212; CodeHim<\/title>\n<meta name=\"description\" content=\"Here is a free code snippet to create a JavaScript Search in Array Of Objects. You can view demo and download the 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\/text-input\/javascript-search-in-array-of-objects\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JavaScript Search in Array Of Objects &#8212; CodeHim\" \/>\n<meta property=\"og:description\" content=\"Here is a free code snippet to create a JavaScript Search in Array Of Objects. You can view demo and download the source code.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/codehim.com\/text-input\/javascript-search-in-array-of-objects\/\" \/>\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-09T18:03:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-22T11:05:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/codehim.com\/wp-content\/uploads\/2023\/10\/JavaScript-Search-in-Array-Of-Objects.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\/text-input\/javascript-search-in-array-of-objects\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/codehim.com\/text-input\/javascript-search-in-array-of-objects\/\"},\"author\":{\"name\":\"Asif Mughal\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed\"},\"headline\":\"JavaScript Search in Array Of Objects\",\"datePublished\":\"2024-01-09T18:03:00+00:00\",\"dateModified\":\"2024-01-22T11:05:07+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/codehim.com\/text-input\/javascript-search-in-array-of-objects\/\"},\"wordCount\":242,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/codehim.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/codehim.com\/text-input\/javascript-search-in-array-of-objects\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2023\/10\/JavaScript-Search-in-Array-Of-Objects.png\",\"keywords\":[\"Search Box\"],\"articleSection\":[\"Text &amp; Input\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/codehim.com\/text-input\/javascript-search-in-array-of-objects\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/codehim.com\/text-input\/javascript-search-in-array-of-objects\/\",\"url\":\"https:\/\/codehim.com\/text-input\/javascript-search-in-array-of-objects\/\",\"name\":\"JavaScript Search in Array Of Objects &#8212; CodeHim\",\"isPartOf\":{\"@id\":\"https:\/\/codehim.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/codehim.com\/text-input\/javascript-search-in-array-of-objects\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/codehim.com\/text-input\/javascript-search-in-array-of-objects\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2023\/10\/JavaScript-Search-in-Array-Of-Objects.png\",\"datePublished\":\"2024-01-09T18:03:00+00:00\",\"dateModified\":\"2024-01-22T11:05:07+00:00\",\"description\":\"Here is a free code snippet to create a JavaScript Search in Array Of Objects. You can view demo and download the source code.\",\"breadcrumb\":{\"@id\":\"https:\/\/codehim.com\/text-input\/javascript-search-in-array-of-objects\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/codehim.com\/text-input\/javascript-search-in-array-of-objects\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codehim.com\/text-input\/javascript-search-in-array-of-objects\/#primaryimage\",\"url\":\"https:\/\/codehim.com\/wp-content\/uploads\/2023\/10\/JavaScript-Search-in-Array-Of-Objects.png\",\"contentUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2023\/10\/JavaScript-Search-in-Array-Of-Objects.png\",\"width\":1280,\"height\":960,\"caption\":\"JavaScript Search in Array Of Objects\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/codehim.com\/text-input\/javascript-search-in-array-of-objects\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/codehim.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Text &amp; Input\",\"item\":\"https:\/\/codehim.com\/category\/text-input\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"JavaScript Search in Array Of Objects\"}]},{\"@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 Search in Array Of Objects &#8212; CodeHim","description":"Here is a free code snippet to create a JavaScript Search in Array Of Objects. You can view demo and download the 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\/text-input\/javascript-search-in-array-of-objects\/","og_locale":"en_US","og_type":"article","og_title":"JavaScript Search in Array Of Objects &#8212; CodeHim","og_description":"Here is a free code snippet to create a JavaScript Search in Array Of Objects. You can view demo and download the source code.","og_url":"https:\/\/codehim.com\/text-input\/javascript-search-in-array-of-objects\/","og_site_name":"CodeHim","article_publisher":"https:\/\/www.facebook.com\/codehimofficial","article_published_time":"2024-01-09T18:03:00+00:00","article_modified_time":"2024-01-22T11:05:07+00:00","og_image":[{"width":1280,"height":960,"url":"https:\/\/codehim.com\/wp-content\/uploads\/2023\/10\/JavaScript-Search-in-Array-Of-Objects.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\/text-input\/javascript-search-in-array-of-objects\/#article","isPartOf":{"@id":"https:\/\/codehim.com\/text-input\/javascript-search-in-array-of-objects\/"},"author":{"name":"Asif Mughal","@id":"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed"},"headline":"JavaScript Search in Array Of Objects","datePublished":"2024-01-09T18:03:00+00:00","dateModified":"2024-01-22T11:05:07+00:00","mainEntityOfPage":{"@id":"https:\/\/codehim.com\/text-input\/javascript-search-in-array-of-objects\/"},"wordCount":242,"commentCount":0,"publisher":{"@id":"https:\/\/codehim.com\/#organization"},"image":{"@id":"https:\/\/codehim.com\/text-input\/javascript-search-in-array-of-objects\/#primaryimage"},"thumbnailUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2023\/10\/JavaScript-Search-in-Array-Of-Objects.png","keywords":["Search Box"],"articleSection":["Text &amp; Input"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/codehim.com\/text-input\/javascript-search-in-array-of-objects\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/codehim.com\/text-input\/javascript-search-in-array-of-objects\/","url":"https:\/\/codehim.com\/text-input\/javascript-search-in-array-of-objects\/","name":"JavaScript Search in Array Of Objects &#8212; CodeHim","isPartOf":{"@id":"https:\/\/codehim.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/codehim.com\/text-input\/javascript-search-in-array-of-objects\/#primaryimage"},"image":{"@id":"https:\/\/codehim.com\/text-input\/javascript-search-in-array-of-objects\/#primaryimage"},"thumbnailUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2023\/10\/JavaScript-Search-in-Array-Of-Objects.png","datePublished":"2024-01-09T18:03:00+00:00","dateModified":"2024-01-22T11:05:07+00:00","description":"Here is a free code snippet to create a JavaScript Search in Array Of Objects. You can view demo and download the source code.","breadcrumb":{"@id":"https:\/\/codehim.com\/text-input\/javascript-search-in-array-of-objects\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/codehim.com\/text-input\/javascript-search-in-array-of-objects\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codehim.com\/text-input\/javascript-search-in-array-of-objects\/#primaryimage","url":"https:\/\/codehim.com\/wp-content\/uploads\/2023\/10\/JavaScript-Search-in-Array-Of-Objects.png","contentUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2023\/10\/JavaScript-Search-in-Array-Of-Objects.png","width":1280,"height":960,"caption":"JavaScript Search in Array Of Objects"},{"@type":"BreadcrumbList","@id":"https:\/\/codehim.com\/text-input\/javascript-search-in-array-of-objects\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/codehim.com\/"},{"@type":"ListItem","position":2,"name":"Text &amp; Input","item":"https:\/\/codehim.com\/category\/text-input\/"},{"@type":"ListItem","position":3,"name":"JavaScript Search in Array Of Objects"}]},{"@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":1055,"_links":{"self":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts\/9520","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=9520"}],"version-history":[{"count":0,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts\/9520\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/media\/9535"}],"wp:attachment":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/media?parent=9520"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/categories?post=9520"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/tags?post=9520"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}