{"id":8920,"date":"2024-01-10T17:56:00","date_gmt":"2024-01-10T17:56:00","guid":{"rendered":"https:\/\/codehim.com\/?p=8920"},"modified":"2024-01-22T15:56:44","modified_gmt":"2024-01-22T10:56:44","slug":"custom-captcha-security-in-javascript","status":"publish","type":"post","link":"https:\/\/codehim.com\/vanilla-javascript\/custom-captcha-security-in-javascript\/","title":{"rendered":"Custom Captcha Security in JavaScript"},"content":{"rendered":"<p>This code implements a custom Captcha security system in JavaScript. It generates a grid of random numbers and marks a subset of them for the user to identify. This Captcha helps verify user interactions on websites.<\/p>\n<p>You can use this code on your <a href=\"https:\/\/codehim.com\/category\/forms\/\" target=\"_blank\" rel=\"noopener\">website&#8217;s forms<\/a> to enhance security. It helps prevent automated bots from submitting forms by requiring users to solve the Captcha puzzle. This improves your website&#8217;s security and ensures that real users are interacting with your content.<\/p>\n<h2>How to Create Custom Captcha Security in JavaScript<\/h2>\n<p>1. Start by creating an HTML form on your webpage where you want to implement the Captcha. You can copy and paste the following HTML code. This code includes the form, Captcha container, and input field.<\/p>\n<pre class=\"prettyprint linenums lang-html\">&lt;form action=\"#\" method=\"POST\" class=\"main-form\" id=\"mainForm\"&gt;\r\n    &lt;h1 id=\"resultCapcha\"&gt;&lt;\/h1&gt;  \r\n    &lt;svg class=\"patternDrow\" height=\"250\" width=\"250\" id=\"patternDrowPolyline\"&gt;&lt;\/svg&gt;  \r\n    &lt;div class=\"captcha-container\" id=\"captchaContainer\"&gt;\r\n      &lt;!-- Captcha Items go here --&gt;\r\n      \r\n    &lt;\/div&gt;\r\n    &lt;div class=\"input-group\"&gt;\r\n      &lt;label for=\"captchaInput\"&gt;Insert the marked numbers in order &lt;br\/&gt; (starting from top left)&lt;\/label&gt;\r\n      &lt;input type=\"text\" autocomplete=\"off\" id=\"captchaInput\"&gt;\r\n    &lt;\/div&gt;\r\n    &lt;input type=\"submit\" value=\"Submit\" class=\"btn submit-btn\"&gt;\r\n  &lt;\/form&gt;<\/pre>\n<p>2. The CSS code included in the snippet ensures that your Captcha looks visually appealing and fits well with your website&#8217;s design. Feel free to customize the styles to match your site&#8217;s theme.<\/p>\n<pre class=\"prettyprint linenums lang-css\">@import url('https:\/\/fonts.googleapis.com\/css2?family=Rubik:wght@400;500;600&amp;display=swap');\r\n\r\n*, *::before, *::after {\r\n  margin: 0;\r\n  padding: 0;\r\n  box-sizing: border-box;\r\n  font-family: 'Rubik', sans-serif;\r\n}\r\n\r\nhtml {\r\n  font-size: 10px;\r\n}\r\n\r\nbody {\r\n  width: 100%;\r\n  height: 100vh;\r\n  display: flex;\r\n  justify-content: center;\r\n  align-items: center;\r\n}\r\n\r\n.captcha-wrong\r\n{\r\ncolor: red;\r\n}\r\n.captcha-success\r\n{\r\ncolor: rgb(5, 201, 15);\r\n}\r\n.marked{\r\n  background-color: royalblue !important;\r\n}\r\n.patternDrow{\r\n  position: absolute;\r\n  z-index: 100;  \r\n  margin-left: 5%;\r\n  text-align: center;\r\n}\r\n.main-form {\r\n  background: #fff;\r\n  width: 40rem;\r\n  padding: 3rem 2rem;\r\n  box-shadow: 0 0 1rem .1rem rgba(0, 0, 0, 0.1);\r\n  border-radius: .5rem;\r\n}\r\n\r\n.captcha-container {\r\n  display: grid;\r\n  justify-content: center;\r\n  grid-template-columns: repeat(3, 8rem);\r\n  grid-auto-rows: 8rem;\r\n  grid-gap: .5rem;\r\n  margin-bottom: 2rem;\r\n}\r\n\r\n.captcha-item {\r\n  display: flex;\r\n  justify-content: center;\r\n  align-items: center;\r\n  background-color: rgb(237, 237, 237);\r\n  font-size: 3rem;\r\n  font-weight: 500;\r\n  position: relative;\r\n}\r\n\r\n.marked::before {\r\n  content: \"&#x2714;\";\r\n  position: absolute;\r\n  top: .5rem;\r\n  right: .5rem;\r\n  font-size: 2rem;\r\n}\r\n\r\nlabel[for=\"captchaInput\"] {\r\n  font-size: 1.6rem;\r\n  font-weight: 500;\r\n}\r\n\r\n#captchaInput {\r\n  display: block;\r\n  width: 100%;\r\n  padding: .8rem 1rem;\r\n  margin-top: 1rem;\r\n  border: .1rem solid rgba(0, 0, 0, .3);\r\n  border-radius: .5rem;\r\n   box-sizing: border-box;\r\n}\r\n\r\n.submit-btn {\r\n  margin-top: 2rem;\r\n  padding: .8rem 2rem;\r\n  color: white;\r\n  background-color: black;\r\n  border: none;\r\n  border-radius: .5rem;\r\n  outline: none;\r\n  font-size: 1.6rem;\r\n  cursor: pointer;\r\n}\r\n\r\n.submit-btn:hover {\r\n  background-color: rgba(0, 0, 0, 0.8);\r\n}<\/pre>\n<p>3. Finally, add the following JavaScript code to your project. This code generates a dynamic Captcha with random numbers and highlights specific numbers for user identification. It also verifies user input against the generated Captcha.<\/p>\n<pre class=\"prettyprint linenums lang-js\">const captchaContainer = document.querySelector(\"#captchaContainer\");\r\nconst captchaInput = document.querySelector(\"#captchaInput\");\r\nconst mainForm = document.querySelector(\"#mainForm\");\r\nconst resultCapcha = document.querySelector(\"#resultCapcha\");\r\nconst patternDrowPolyline = document.querySelector(\"#patternDrowPolyline\");\r\nconst gridCount = 9;\r\n\r\nlet result = \"\";\r\n\r\nconst createCaptcha = () =&gt; {\r\n  var points = \"\";\r\n  var markCount = 0;\r\n  var captchaItemList = []; \r\n\r\n  for (let i = 0; i &lt; gridCount; i++) {\r\n    var captchaItem = document.createElement(\"div\");\r\n    captchaItem.classList.add(\"captcha-item\");\r\n    \/\/ captchaItem.id = `captcha-item-${i}`;\r\n\r\n    const randNum = Math.random().toString(20).substr(2, 1);\r\n    \r\n    captchaContainer.appendChild(captchaItem);\r\n    captchaItem.innerHTML = randNum;\r\n  }\r\n    \r\n  const captchaItemId = document.getElementsByClassName(\"captcha-item\");\r\n\r\n\r\n    while(markCount &lt; 5){\r\n        let selectCaptchaItem = Math.floor(Math.random() * 8);\r\n        \r\n        if(captchaItemList.includes(selectCaptchaItem) == false){\r\n            captchaItemList.push(selectCaptchaItem);\r\n            captchaItemId[selectCaptchaItem].classList.add(\"marked\");\r\n            markCount++;\r\n        }\r\n    }\r\n\r\n    captchaItemList.sort();\r\n\r\n    captchaItemList.forEach(element =&gt; {\r\n        switch (element) {\r\n            case 0:\r\n            points += \"40,40,\";\r\n            break;\r\n            case 1:\r\n            points += \"125,40,\";\r\n            break;\r\n            case 2:\r\n            points += \"210,40,\";\r\n            break;\r\n            case 3:\r\n            points += \"40,120,\";\r\n            break;\r\n            case 4:\r\n            points += \"125,120,\";\r\n            break;\r\n            case 5:\r\n            points += \"210,120,\";\r\n            break;\r\n            case 6:\r\n            points += \"40,210,\";\r\n            break;\r\n            case 7:\r\n            points += \"125,210,\";\r\n            break;\r\n            case 8:\r\n            points += \"210,210,\";\r\n            break;\r\n        }\r\n\r\n        result += captchaItemId[element].innerHTML;    \r\n    });\r\n    patternDrowPolyline.innerHTML = (\"&lt;polyline points='\" + points + \"' style='fill:none;stroke:rgb(38, 216, 2);stroke-width:3' \/&gt;\");\r\n    console.log(captchaItemList);\r\n      \r\n\r\n    \/\/ }\r\n  \/\/ alert(points);\r\n\/\/   patternDrowPolyline.innerHTML = (\"&lt;polyline points='\" + points + \"' style='fill:none;stroke:rgb(38, 216, 2);stroke-width:3' \/&gt;\");\r\n};\r\n\r\ncreateCaptcha();\r\n\r\ncaptchaInput.addEventListener(\"input\", () =&gt; {\r\n  \/\/ alert('val'+captchaInput.value );\r\n  \/\/ alert('res'+result );\r\n  if (captchaInput.value != result) {\r\n    captchaInput.classList.add(\"wrong-captcha\");\r\n    resultCapcha.innerHTML = \"Wrong Captcha\";\r\n    resultCapcha.classList.add(\"captcha-wrong\");\r\n    resultCapcha.classList.remove(\"captcha-success\");\r\n  } else {\r\n    captchaInput.classList.remove(\"wrong-captcha\");\r\n    resultCapcha.classList.remove(\"captcha-wrong\");\r\n    resultCapcha.classList.add(\"captcha-success\");\r\n    resultCapcha.innerHTML = \"Captcha Verified\";\r\n  }\r\n});\r\n\r\n\/\/ Get the modal\r\nvar modal = document.getElementById(\"myModal\");\r\n\/\/ Get the button that opens the modal\r\nvar btn = document.getElementById(\"submit\");\r\n\/\/ Get the &lt;span&gt; element that closes the modal\r\nvar span = document.getElementsByClassName(\"close\")[0];\r\nvar message = document.getElementById(\"message\");\r\n\r\nbtn.onclick = function() {\r\n  if (captchaInput.value != result) {\r\n    modal.style.display = \"block\";\r\n    message.innerHTML = \"Wrong Captcha!! Try again\"\r\n    message.style.color = \"red\";\r\n  } else {\r\n    modal.style.display = \"block\";\r\n    message.innerHTML = \"Captcha Varified\"\r\n    message.style.color = \"green\";\r\n  }\r\n}\r\n\r\nspan.onclick = function() {\r\n  modal.style.display = \"none\";\r\n}\r\n\r\n\/\/ mainForm.addEventListener(\"submit\", (e) =&gt; {\r\n\/\/   if (\r\n\/\/     captchaInput.classList.contains(\"wrong-captcha\") ||\r\n\/\/     (!captchaInput.value.length &amp;&amp; result.length)\r\n\/\/   ) {\r\n\/\/     e.preventDefault();\r\n\/\/   }\r\n\/\/ });<\/pre>\n<p>That&#8217;s all! hopefully, you have successfully created a custom Captcha Security in JavaScript. If you have any questions or suggestions, feel free to comment below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This code implements a custom Captcha security system in JavaScript. It generates a grid of random numbers and marks a&#8230;<\/p>\n","protected":false},"author":1,"featured_media":8927,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[116],"tags":[],"class_list":["post-8920","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>Custom Captcha Security in JavaScript &#8212; CodeHim<\/title>\n<meta name=\"description\" content=\"Here is a free code snippet to create a Custom Captcha Security in JavaScript. 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\/vanilla-javascript\/custom-captcha-security-in-javascript\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Custom Captcha Security in JavaScript &#8212; CodeHim\" \/>\n<meta property=\"og:description\" content=\"Here is a free code snippet to create a Custom Captcha Security in JavaScript. You can view demo and download the source code.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/codehim.com\/vanilla-javascript\/custom-captcha-security-in-javascript\/\" \/>\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:56:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-22T10:56:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/codehim.com\/wp-content\/uploads\/2023\/10\/Custom-Captcha-Security-in-JavaScript.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=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/custom-captcha-security-in-javascript\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/custom-captcha-security-in-javascript\/\"},\"author\":{\"name\":\"Asif Mughal\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed\"},\"headline\":\"Custom Captcha Security in JavaScript\",\"datePublished\":\"2024-01-10T17:56:00+00:00\",\"dateModified\":\"2024-01-22T10:56:44+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/custom-captcha-security-in-javascript\/\"},\"wordCount\":223,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/codehim.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/custom-captcha-security-in-javascript\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2023\/10\/Custom-Captcha-Security-in-JavaScript.png\",\"articleSection\":[\"Vanilla JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/codehim.com\/vanilla-javascript\/custom-captcha-security-in-javascript\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/custom-captcha-security-in-javascript\/\",\"url\":\"https:\/\/codehim.com\/vanilla-javascript\/custom-captcha-security-in-javascript\/\",\"name\":\"Custom Captcha Security in JavaScript &#8212; CodeHim\",\"isPartOf\":{\"@id\":\"https:\/\/codehim.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/custom-captcha-security-in-javascript\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/custom-captcha-security-in-javascript\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2023\/10\/Custom-Captcha-Security-in-JavaScript.png\",\"datePublished\":\"2024-01-10T17:56:00+00:00\",\"dateModified\":\"2024-01-22T10:56:44+00:00\",\"description\":\"Here is a free code snippet to create a Custom Captcha Security in JavaScript. You can view demo and download the source code.\",\"breadcrumb\":{\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/custom-captcha-security-in-javascript\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/codehim.com\/vanilla-javascript\/custom-captcha-security-in-javascript\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/custom-captcha-security-in-javascript\/#primaryimage\",\"url\":\"https:\/\/codehim.com\/wp-content\/uploads\/2023\/10\/Custom-Captcha-Security-in-JavaScript.png\",\"contentUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2023\/10\/Custom-Captcha-Security-in-JavaScript.png\",\"width\":1280,\"height\":960,\"caption\":\"Custom Captcha Security in JavaScript\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/custom-captcha-security-in-javascript\/#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\":\"Custom Captcha Security in JavaScript\"}]},{\"@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":"Custom Captcha Security in JavaScript &#8212; CodeHim","description":"Here is a free code snippet to create a Custom Captcha Security in JavaScript. 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\/vanilla-javascript\/custom-captcha-security-in-javascript\/","og_locale":"en_US","og_type":"article","og_title":"Custom Captcha Security in JavaScript &#8212; CodeHim","og_description":"Here is a free code snippet to create a Custom Captcha Security in JavaScript. You can view demo and download the source code.","og_url":"https:\/\/codehim.com\/vanilla-javascript\/custom-captcha-security-in-javascript\/","og_site_name":"CodeHim","article_publisher":"https:\/\/www.facebook.com\/codehimofficial","article_published_time":"2024-01-10T17:56:00+00:00","article_modified_time":"2024-01-22T10:56:44+00:00","og_image":[{"width":1280,"height":960,"url":"https:\/\/codehim.com\/wp-content\/uploads\/2023\/10\/Custom-Captcha-Security-in-JavaScript.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":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/codehim.com\/vanilla-javascript\/custom-captcha-security-in-javascript\/#article","isPartOf":{"@id":"https:\/\/codehim.com\/vanilla-javascript\/custom-captcha-security-in-javascript\/"},"author":{"name":"Asif Mughal","@id":"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed"},"headline":"Custom Captcha Security in JavaScript","datePublished":"2024-01-10T17:56:00+00:00","dateModified":"2024-01-22T10:56:44+00:00","mainEntityOfPage":{"@id":"https:\/\/codehim.com\/vanilla-javascript\/custom-captcha-security-in-javascript\/"},"wordCount":223,"commentCount":0,"publisher":{"@id":"https:\/\/codehim.com\/#organization"},"image":{"@id":"https:\/\/codehim.com\/vanilla-javascript\/custom-captcha-security-in-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2023\/10\/Custom-Captcha-Security-in-JavaScript.png","articleSection":["Vanilla JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/codehim.com\/vanilla-javascript\/custom-captcha-security-in-javascript\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/codehim.com\/vanilla-javascript\/custom-captcha-security-in-javascript\/","url":"https:\/\/codehim.com\/vanilla-javascript\/custom-captcha-security-in-javascript\/","name":"Custom Captcha Security in JavaScript &#8212; CodeHim","isPartOf":{"@id":"https:\/\/codehim.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/codehim.com\/vanilla-javascript\/custom-captcha-security-in-javascript\/#primaryimage"},"image":{"@id":"https:\/\/codehim.com\/vanilla-javascript\/custom-captcha-security-in-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2023\/10\/Custom-Captcha-Security-in-JavaScript.png","datePublished":"2024-01-10T17:56:00+00:00","dateModified":"2024-01-22T10:56:44+00:00","description":"Here is a free code snippet to create a Custom Captcha Security in JavaScript. You can view demo and download the source code.","breadcrumb":{"@id":"https:\/\/codehim.com\/vanilla-javascript\/custom-captcha-security-in-javascript\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/codehim.com\/vanilla-javascript\/custom-captcha-security-in-javascript\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codehim.com\/vanilla-javascript\/custom-captcha-security-in-javascript\/#primaryimage","url":"https:\/\/codehim.com\/wp-content\/uploads\/2023\/10\/Custom-Captcha-Security-in-JavaScript.png","contentUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2023\/10\/Custom-Captcha-Security-in-JavaScript.png","width":1280,"height":960,"caption":"Custom Captcha Security in JavaScript"},{"@type":"BreadcrumbList","@id":"https:\/\/codehim.com\/vanilla-javascript\/custom-captcha-security-in-javascript\/#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":"Custom Captcha Security in JavaScript"}]},{"@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":1103,"_links":{"self":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts\/8920","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=8920"}],"version-history":[{"count":0,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts\/8920\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/media\/8927"}],"wp:attachment":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/media?parent=8920"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/categories?post=8920"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/tags?post=8920"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}