title: jQuery change input type
body: <p>This code doesn't work what's wrong?</p>
  
  <pre><code>$(".re").focus(function() {
      if($(this).attr("type") == "text") {
          $(this).attr("type", "password");
      }
  }); 
  </code></pre>
  
  <p>It's supposed to change the input text type from text, to password, but doesn't work when I type in it after I get into focus on it; it's still text.</p>