Show / hide password

Switch the input type between password and text.

jQuery · Show / hide passwordBeginner
$('#toggle').on('click', function () {
  var $pw = $('#password');
  var show = $pw.attr('type') === 'password';
  $pw.attr('type', show ? 'text' : 'password');
  $(this).text(show ? 'Hide' : 'Show');
});
formuipassword