How can I have I button such that onclick it creates a reCAPTCHA?
Here is what I have:
<script>
function myFunc() {
document.getElementById("form").innerHTML = "<div class=\"g-recaptcha\" data-sitekey=\"myspecialcodewhichisasecret\"></div>";
}
</script>
<form action="/whatever" id="form" method="post">
</form>
<button onclick="myFunc()">CLICK ME AND GET FREE RECAPTCHA</button>
I am using localhost, which google says should be ok. Why doesn't the recpatcha show up when I click the button?
grecaptcha.render()function.