title: how to change the background colour of a textbox on click
body: <p>i am new to java script, so i had a doubt. i have created a form with username and password,i need to know how to change the background color of the text box on click? it will be helpful. 
  My code:</p>
  
  <pre><code> &lt;script type="text/javascript"&gt;    
   function AllowLock(){
                 if (!locker.lock.value.match(/[a-zA-Z]$/) &amp;&amp; locker.lock.value !="")
                 {
                      locker.lock.value="";                     
                      alert("Please Enter only valid lock");
                 }
                 if(locker.lock.value.length &gt; 5)
                 alert("max length exceeded");               
               } 
  function AllowKey(){
                 if (!locker.keys.value.match(/[a-zA-Z]$/) &amp;&amp; !locker.keys.value.match(/[0-9]+$/))
                 {
                      locker.keys.value="";                   
                      alert("Please Enter only valid key");
                 }
                 if(locker.keys.value.length &gt; 5)
                 alert("max length exceeded");               
               }           
  
  function LockName(){
   {
   if(locker.lock.value.length==0)
  document.getElementById('errfn').innerHTML="this is invalid name";
  } 
  
  {
   if(locker.keys.value.length==0)
   document.getElementById('error').innerHTML="this is invalid key";
   }
   }
   &lt;/script&gt;  
  </code></pre>