How to Implement on VanillaJS


First, you should get your Captcha ID and Captcha Div ID
Please visit for more information: Displaying Lemin CAPTCHA


Add an empty div element where you want to display your Lemin Captcha. 

Lemin Captcha must be placed inside of a “form” element.

<div id="lemin-cropped-captcha"></div> // your captcha div id

This component prepares the lemin captcha and marks where the captcha will appear if necessary.

Please ensure that your captcha div id is the same as the captcha div id you've set before. If you set a captcha-div-id for your Lemin Captcha in the advanced settings, this div must have that same captcha-div-id. (default: "lemin-cropped-captcha")


Add script tag to your View

<script src=""></script>


const captchaContainer = document.getElementById('lemin-cropped-captcha'); // your captcha div id
const leminScript = document.createElement('script');
leminScript.setAttribute('src', '');

This div and script elements can be placed just above your “Submit” or “Login” buttons.

JavaScript code must be outside of the “div” element, do not paste the code inside the “div” element.

<div id="lemin-cropped-captcha"></div>
<script src="..."></script>

Usage Examples

  const form = document.getElementById("lemin-form");

  form.addEventListener("submit", onSubmit);

  function onSubmit(event) {

    const captchaValues = window.leminCroppedCaptcha

    const isCaptchaValid = captchaValues.answer && captchaValues.challenge_id;

    if (isCaptchaValid) {
      //execute your method

<form id="lemin-form">
  <div id="lemin-cropped-captcha"></div>
<script src="..."></script>

  <button className="btn btn-primary" type="submit">

Please, find below the example GitHub repository.