placeholder works for text but not password box in IE/Firefox using this javascript
<p>Js File</p>

<pre><code>//Modified from http://www.beyondstandards.com/archives/input-placeholders/
function activatePlaceholders()
{
    var detect = navigator.userAgent.toLowerCase(); 
    if (detect.indexOf("safari") &gt; 0) return false;
    var inputs = document.getElementsByTagName("input");
    for (var i=0;i&lt;inputs.length;i++)
    {
        if (inputs[i].getAttribute("type") == "text")
        {
            var placeholder = inputs[i].getAttribute("placeholder");
            if (placeholder.length &gt; 0)
            {
                inputs[i].value = placeholder;
                inputs[i].onclick = function()
                {
                    if (this.value == this.getAttribute("placeholder"))
                    {
                        this.value = "";
                    }
                    return false;
                }
                inputs[i].onblur = function()
                {
                    if (this.value.length &lt; 1)
                    {
                        this.value = this.getAttribute("placeholder");
                    }
                }
            }
        }
        else if (inputs[i].getAttribute("type") == "password")
        {
            var placeholder = inputs[i].getAttribute("placeholder");
            if (placeholder.length &gt; 0)
            {
                inputs[i].value = placeholder;
                inputs[i].onclick = function()
                {
                    if (this.value == this.getAttribute("placeholder"))
                    {
                        this.value = "";
                    }
                    return false;
                }
                inputs[i].onblur = function()
                {
                    if (this.value.length &lt; 1)
                    {
                        this.value = this.getAttribute("placeholder");
                    }
                }
            }
        }
    }
}
window.onload = function()
{
    activatePlaceholders();
}
</code></pre>

<p>Html part</p>

<pre><code>&lt;form name="input" action="login.php" method="post"&gt;
        &lt;table width="*" border="0"&gt;
        &lt;tr&gt;
        &lt;td align="left"&gt;&lt;input type="text" name="username" placeholder="Username" /&gt;&amp;nbsp;&lt;input type="password" name="pass" placeholder="Password" /&gt;&lt;input type="submit" value="Login" /&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
        &lt;td colspan="2" align="right"&gt;Stay logged in:&amp;nbsp;&lt;input type="checkbox" name="remember" value="1"&gt;&amp;nbsp;&amp;nbsp;Sign Up | Forgot Password&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;/table&gt;
        &lt;/form&gt;
</code></pre>

<p>This works for the input box. Not working for the password box. It wants to star out the place holder text on the password. I want to users password to be started out but not the place holder. Not sure how to fix that so it works in IE and Firefox.</p>
