Why isn't this code jquery working?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1970793/changing-password-field-to-text-with-checkbox-with-jquery">changing password field to text with checkbox with jquery</a>  </p>
</blockquote>



<p>The code is supposed to check if a checkbox is checked, then change a password field from password to regular text and vice versa. </p>

<pre><code>$('#cpassword_lf').change(function(){
     if($('#cpassword_lf').is(':checked'))
     {
        $('#password_loginform').attr('type', 'text'); 
     }
     else
     {
         $('#password_loginform').attr('type', 'password'); 
     }  
 });
</code></pre>
