how to change textbox background color through javascript?
<p>my javascript-</p>

<pre><code>function validate_loginform(loginform) 
{
var uid = loginform.uid.value;
var pass = loginform.pass.value;
if(uid == "") 
  {

    color('uid');       
    return false;
  }
if(pass == 0) 
  {
    color('pass');
    return false;
  }

return true;
</code></pre>

<p>}</p>

<pre><code>function color(traget)
{
var targetbox = document.getElementById(target);
targetbox.style.backgroundColor="red";
}
</code></pre>

<p>but background color is not getting changed even it is not returning <code>fasle</code> value. if I remove the <code>color('uid');</code> nad put <code>alert("user name required");</code> then this script is working fine.Whats wrong?<br>
<strong>it backgroundColor in actual program I just missed it here only</strong></p>
