JQuery change type of input field
<pre><code>$(document).ready(function() {
    // #login-box password field
    $('#password').attr('type', 'text');
    $('#password').val('Password');
});
</code></pre>

<p>This is supposed to change the #password input field (with id="password") which is of type password to a normal text field and fill in the text "Password".</p>

<p>It doesn't work though. Why?</p>

<p>Here is the form:</p>

<pre><code>&lt;form enctype="application/x-www-form-urlencoded" method="post" action="/auth/sign-in"&gt;
  &lt;ol&gt;
    &lt;li&gt;
      &lt;div class="element"&gt;
        &lt;input type="text" name="username" id="username" value="Prihlasovacie meno" class="input-text" /&gt;
      &lt;/div&gt;
    &lt;/li&gt;
    &lt;li&gt;
      &lt;div class="element"&gt;
        &lt;input type="password" name="password" id="password" value="" class="input-text" /&gt;
      &lt;/div&gt;
    &lt;/li&gt;
    &lt;li class="button"&gt;
      &lt;div class="button"&gt;
        &lt;input type="submit" name="sign_in" id="sign_in" value="Prihlásiť" class="input-submit" /&gt;
      &lt;/div&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
&lt;/form&gt;
</code></pre>
