<form id="form-send">
<p>Key:<br> <input name="key" type="text"></p>
<div class="g-recaptcha" data-sitekey="my_key_recaptcha"></div>
<p><input name="button" type="submit" value="Отправить"></p>
</form>
<script>
$("#form-send").submit(function(e) {
e.preventDefault();
var captcha = $('g-recaptcha-response').val();
console.log(captcha);
var key = $("#key").val();
$.ajax({
type: "POST",
url: "sendKey.php",
data: {
"key": key
},
cache: false,
success: function(response) {
alert("ok");
}
}).done(function() {
//
});
});
</script>
Но выводит undefined
<script src="https://www.google.com/recaptcha/api.js"></script>
Подключен