Skip to content

Instantly share code, notes, and snippets.

@jmcamposdev
Last active August 1, 2023 08:18
Show Gist options
  • Save jmcamposdev/8eead4dd28490ed863a1b1d63c91a700 to your computer and use it in GitHub Desktop.
Save jmcamposdev/8eead4dd28490ed863a1b1d63c91a700 to your computer and use it in GitHub Desktop.
Solved WAVE Recaptcha (Missing form label)
window.addEventListener("load", (event) => {
let grecaptchaContainer = document.querySelector(".grecaptcha-badge");
if (grecaptchaContainer) {
let grecaptchaTextarea = grecaptchaContainer.querySelector("textarea");
let grecaptchaLabel = document.createElement("label");
grecaptchaLabel.textContent = "Recaptcha";
grecaptchaLabel.style.fontSize = "0px";
grecaptchaLabel.setAttribute("for", grecaptchaTextarea.id);
grecaptchaContainer.appendChild(grecaptchaLabel);
}
});
@jmcamposdev
Copy link
Author

Wordpress
Using this snippet you can solve the WAVE WAVE Recaptcha (Missing form label)
image
image

If you have this Euros adding the Recaptcha to the Wordpress form flow this steps to solve:

  • Add this code to your footer and will be load in all pages

Is create to WAVE Accessibility --> https://wave.webaim.org/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment