0

I want to execute a function (lets make alert()) at the time when recaptcha is solved by a user. When it is solved, the green tick appears.

It seems that it is possible only with the grecaptcha.render() function. Yes?

Example site where it should work:
https://tii.ai/rJBTt

Recaptcha documentation:
https://developers.google.com/recaptcha/docs/display

oleedd
  • 388
  • 2
  • 15

1 Answers1

0

Well, you could use Jquery to target the two states that recaptcha is in - the two are

the uses aria-checked="true" or "false"

$(document).ready(function(e) {
    //find the recaptcha span 
    var u = $('span[aria-checked]');
        if(u.val() == "true") {
            //the recaptcha was checked
            //do something
        }
})
  • Can you write code which makes `alert()` (when recaptcha becomes solved) on the example site link? For now I don't see anything useful or new in your answer. And anyway, recaptcha can't be solved at the `$(document).ready` event. – oleedd Mar 06 '21 at 20:16
  • And that element is in ` – oleedd Mar 06 '21 at 20:20
  • It is not an answer! – oleedd Mar 10 '21 at 15:06