title: How to create HTML for a "show password" functionality?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1544317/jquery-change-type-of-input-field">JQuery change type of input field</a>  </p>
  </blockquote>
  
  
  
  <p>Demo here:</p>
  
  <p><a href="http://jsbin.com/welcome/73795/edit" rel="nofollow noreferrer">http://jsbin.com/welcome/73795/edit</a></p>
  
  <hr>
  
  <pre><code>&lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"&gt;&lt;/script&gt;
  
  
  &lt;input type="password" name="password" /&gt;
  &lt;button&gt;Show Password&lt;/button&gt;
  
  $(document).ready(function() {
    $('button').click(function() {
      $('input').attr('type', 'text');
    });
  });
  </code></pre>
  
  <hr>
  
  <p>I'm trying to create a button (or checkbox) that users will be able to toggle to see their password written in plain text.</p>
  
  <p>This is basically for portable devices where typing in passwords is a pain, and seeing it in plain text while writing is a UX improvement.</p>
  
  <p>In my example above, changing the type of the input doesn't work. </p>
  
  <p>Any suggestions on how to tackle this problem?</p>