Changing Attribute "type" from text to password
<p>Why isn't the jQuery changing the type attribute of #password_input to password?</p>

<pre><code>&lt;html&gt;
    &lt;head&gt;
        &lt;title&gt;&lt;/title&gt;
        &lt;style type="text/css"&gt;
        &lt;/style&gt;
        &lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"&gt;&lt;/script&gt;
        &lt;script type="text/javascript"&gt;
        $(document).ready(function() {
            $("#password_input").attr('type','password');
        });
        &lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;div id="loginBox"&gt;
            &lt;form&gt;
            &lt;input type="text" id="username_input" name="username" /&gt;&lt;br /&gt;
            &lt;input type="text" id="password_input" name="password" /&gt;
            &lt;/form&gt;
        &lt;/div&gt;
    &lt;/body&gt;
&lt;/html&gt;
</code></pre>
