title: Jquery show/hide password
body: <p>Below Jquery is working fine but How could I shorten this Jquery? I have to show and hide the password for password and confirmed password? <a href="https://jsfiddle.net/c5cvLo54/1/" rel="noreferrer">https://jsfiddle.net/c5cvLo54/1/</a></p>
  
  <pre><code>$(".password-showhide .show-password").click(function() {
      $("#password").attr("type", "text");
      $(".password-showhide .show-password").hide();
      $(".password-showhide .hide-password").show();
  });
  $(".password-showhide .hide-password").click(function() {
      $("#password").attr("type", "password");
      $(".password-showhide .hide-password").hide();
      $(".password-showhide .show-password").show();
  });
  
  $(".confirm-password-showhide .show-password").click(function() {
      $("#confirmPassword").attr("type", "text");
      $(".confirm-password-showhide .show-password").hide();
      $(".confirm-password-showhide .hide-password").show();
  });
  $(".confirm-password-showhide .hide-password").click(function() {
      $("#confirmPassword").attr("type", "password");
      $(".confirm-password-showhide .hide-password").hide();
      $(".confirm-password-showhide .show-password").show();
  });
  </code></pre>