var mysitekey = 'key';
var gcaptcha = function() {
$().ready(function() {
$('.grecaptcha').each(function(index, element) {
var id = $(this).attr('id');
window['captcha_'+id] = grecaptcha.render(id, { 'sitekey' : mysitekey });
})
});
};
<script src="https://www.google.com/recaptcha/api.js?onload=gcaptcha&render=explicit"></script>