Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="row">
  <div class="mb-3 mt-2">
    <center>
      <h2>Recaptcha V3 Complete Code</h2>
    </center>
  </div>
</div>
<div class="row mt-2 mb-2">
  <div class="col">
    <form id='demo-form' action="?" method="POST">
      <button type="submit" class="btn btn-block">Inspect This FORM F12</button>
    </form>
  </div>
  <div class="col">
    <button class="btn-block btn" onclick="gexec()">Refresh</button>
  </div>
</div>

<div class="row m-2">
  <div class="col-md-12">
    <pre id="token">Token</pre>
  </div>
</div>

              
            
!

CSS

              
                * {
  word-wrap: break-word;
}
              
            
!

JS

              
                if (typeof jQuery == 'undefined' || !window.jQuery) {
  var hs = document.createElement('script'); 
  hs.type = 'text/javascript'; 
  hs.async = true;
  hs.src = 'https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js';
  document.getElementsByTagName('head')[0].appendChild(hs);
  document.getElementsByTagName('body')[0].appendChild(hs);
  document.head.appendChild(hs);
  document.body.appendChild(hs);
}

if (location.host == 'cdpn.io'){
  console.clear();
}
const g_site_key = '6LdSg5gUAAAAAKrfCL7OkHCFrS3m09xoWyvFKieF';
(function () {
  submitDisable();
  download_script('https://www.google.com/recaptcha/api.js?render='+g_site_key+'&render=explicit', function () {
    grecaptcha.ready(function () {
      gexec();
    });
  });
})();

function gexec(){ //also refresh function
  grecaptcha.execute(g_site_key, { action: 'homepage' }).then(function (token) {
    if (location.host == 'cdpn.io'){
      var pr = $('pre#token');
      if (pr.length){
        pr.text(token);
      }
    }
    submitEnable();
    recaptcha_insert_token(token);
  });
}

  function recaptcha_insert_token(token) {
    if (typeof jQuery == 'undefined'){
      console.log('JQuery Not Loaded');
    } else {
      var f = $('form'), fg = f.find('[name="g-recaptcha-response"]');
    if (fg.length === 0){
      $('<input type="hidden" readonly value="' + token + '" name="g-recaptcha-response">').appendTo(f);
    } else {
      fg.val(token);
    }
    }
  }

  function submitEnable() {
    var woo_buttons = [".woocommerce-form-login button", ".woocommerce-form-register button", ".woocommerce-ResetPassword button"];
    if (typeof jQuery != 'undefined') {
      $.each(woo_buttons, function (i, btn) {
        $(btn).removeAttr('disabled');
      });
      $('[type="submit"], #wp-submit, #submit').prop('disabled', false);
    } else {
      console.log('jquery not loaded');
    }
  }

  function submitDisable() {
    var woo_buttons = [".woocommerce-form-login button", ".woocommerce-form-register button", ".woocommerce-ResetPassword button"];
    if (typeof jQuery == 'undefined'){
      console.log('jQuery not loaded');
    } else {
      jQuery.each(woo_buttons, function (i, btn) {
      jQuery(btn).attr('disabled', 'disabled');
    });
    $('[type="submit"], #wp-submit, #submit').prop('disabled', true);
    }
  }

function download_script(url, success = false) {
  var script = document.createElement('script');
  script.src = url;
  var head = document.getElementsByTagName('head')[0],
    done = false;
  if (success) {
    script.onload = script.onreadystatechange = function () {
      if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete')) {
        done = true;
        success();
        script.onload = script.onreadystatechange = null;
        head.removeChild(script);
      }
    }
  };
  head.appendChild(script);
}
  
  
              
            
!
999px

Console