diff --git a/drupal-recaptcha.js b/drupal-recaptcha.js
new file mode 100644
index 0000000..c369c47
--- /dev/null
+++ b/drupal-recaptcha.js
@@ -0,0 +1,18 @@
+(function ($) {
+
+Drupal.behaviors.recaptcha = {
+  attach: function (context, settings) {
+    $('.drupal-recaptcha', context).each(function() {
+      if ($(this).hasClass('drupal-recaptcha-processed')) {
+        grecaptcha.reset();
+      }
+      else {
+        grecaptcha.render(this, $(this).data());
+        $(this).addClass('drupal-recaptcha-processed');
+      }
+
+    });
+  }
+}
+
+})(jQuery);
diff --git a/recaptcha.module b/recaptcha.module
index e0e31e6..710a4a4 100644
--- a/recaptcha.module
+++ b/recaptcha.module
@@ -105,7 +105,7 @@ function recaptcha_captcha($op, $captcha_type = '') {
           }
 
           $attributes = array(
-            'class' => 'g-recaptcha',
+            'class' => 'drupal-recaptcha',
             'data-sitekey' => $recaptcha_site_key,
             'data-theme' => variable_get('recaptcha_theme', 'light'),
             'data-type' => variable_get('recaptcha_type', 'image'),
@@ -117,6 +117,9 @@ function recaptcha_captcha($op, $captcha_type = '') {
           $captcha['form']['recaptcha_widget'] = array(
             '#markup' => '<div' . drupal_attributes($attributes) . '></div>',
             '#suffix' => $noscript,
+            '#attached' => array(
+              'js' => array(drupal_get_path('module', 'recaptcha') . '/drupal-recaptcha.js'),
+            ),
           );
 
           // @todo: #1664602: D7 does not yet support "async" in drupal_add_js().
diff --git a/recaptcha.test b/recaptcha.test
index 48b409b..b555d4a 100644
--- a/recaptcha.test
+++ b/recaptcha.test
@@ -93,7 +93,7 @@ class ReCaptchaBasicTest extends DrupalWebTestCase {
 
     $site_key = $this->randomName(40);;
     $secret_key = $this->randomName(40);;
-    $grecaptcha = '<div class="g-recaptcha" data-sitekey="' . $site_key . '" data-theme="light" data-type="image"></div>';
+    $grecaptcha = '<div class="drupal-recaptcha" data-sitekey="' . $site_key . '" data-theme="light" data-type="image"></div>';
 
     // Test if login works.
     $this->drupalLogin($this->normal_user);
