title: text field doesn't get filled when i have written to act so
body: <p>The following is a script which empties the <em>Username</em> text field and the <em>Password</em> text field when the it is clicked upon. I want if the user starts filling the password field with username field empty the username field should get filled with its default value and the same goes for the password field. Though the text field gets emptied upon the click it doesn't get filled with the values if the user proceeds with filling the next field leaving the other field empty for that moment. What is the problem ?</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function emptyTextField() {
      document.getElementById("username").value="";
              if( document.getElementById("password").value =="" ) {
                  document.getElementById("password").value == "password";
              }
  }
  
  function emptyPasswordField() {
      document.getElementById("password").value="";
              if( document.getElementById("username").value == "" ) {
                  document.getElementById("username").value == "Username or Email";
              }
  }
  </code></pre>
  
  <p></p>
  
  <p>HTML code :</p>
  
  <pre><code>&lt;ul&gt;  &lt;form method="post" action="#"&gt;
            &lt;li&gt; &lt;input type="text" id="username" value="Username or Email" size="25" name="UserID"  onfocus="emptyTextField()" /&gt; &lt;/li&gt;
            &lt;li&gt; &lt;input type="password" id="password" value="password" size="25" name="UserPassword" onfocus="emptyPasswordField()" /&gt; 
            &lt;center&gt;&lt;input type="submit" value="sign-in" style="font-size:20px" /&gt; &lt;/center&gt;
            &lt;/li&gt;
                &lt;/form&gt;
          &lt;/ul&gt;
  </code></pre>