diff --git a/core/modules/user/user.js b/core/modules/user/user.js
index 82d165c..f3bbd0a 100644
--- a/core/modules/user/user.js
+++ b/core/modules/user/user.js
@@ -81,6 +81,31 @@
     }
   };
 
+  Drupal.behaviors.showPassword = {
+    attach: function (context) {
+      // Create the checkbox.
+      var showPassword = $('<button data-show-password-trigger class="link">' + Drupal.t('Show password') + '</button>');
+      // Add checkbox to all password field on the current page.
+      showPassword.insertAfter($(context).find(':password'));
+      // Add click handler to checkboxes.
+      $(context).find('[data-show-password-trigger]').data('state','hidden').click(function (e) {
+        e.preventDefault();
+        if ($(this).data('state') === 'hidden') {
+          // Switch password input type to text.
+          $(this).closest('.form-type-password').find(':password').attr('type', 'text');
+          $(this).text(Drupal.t('Hide password'));
+          $(this).data('state','shown');
+        }
+        else {
+          // Switch the input type back to password.
+          $(this).closest('.form-type-password').find(':text').attr('type', 'password');
+          $(this).text(Drupal.t('Show password'));
+          $(this).data('state','hidden');
+        }
+      });
+    }
+  };
+
   /**
    * Evaluate the strength of a user's password.
    *
