From 5a2bd25a9916a4c5a1a8420fc43946e18b17abea Mon Sep 17 00:00:00 2001 From: Marc Jauvin Date: Sun, 6 Mar 2022 19:35:29 -0500 Subject: [PATCH] convert recaptcha to vanilla js (#11) --- assets/js/recaptcha.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/js/recaptcha.js b/assets/js/recaptcha.js index 753c207..b8cf89e 100644 --- a/assets/js/recaptcha.js +++ b/assets/js/recaptcha.js @@ -1,12 +1,12 @@ var captchas = []; var onloadCallback = function() { - jQuery('.g-recaptcha').each(function(index, el) { - captchas[el.id] = grecaptcha.render(el, $(el).data()); + document.querySelectorAll('.g-recaptcha').forEach(function(el) { + captchas[el.id] = grecaptcha.render(el, el.dataset.id); }); } function resetReCaptcha(id) { var widget = captchas[id]; grecaptcha.reset(widget); -} \ No newline at end of file +}