grecaptcha.ready(() => { grecaptcha.execute('6LcxMQokAAAAAC31182N1CCz5VE8ByjpWoMONddp', { action: 'contact' }).then(token => { document.querySelector('#recaptchaResponse').value = token; }); });