title: Check for CapsLock ON in "onfocus" event
body: <p>My following code for checking whether Capslock is on or not works fine on "onkeypress" event.</p>
  
  <p>But i want it for "onfocus" event.
   i tried replacing "onkeypress" with "onfocus" for the control,but it doesnt work for me.</p>
  
  <p>Any help? (either in javascript or Jquery)</p>
  
  <pre><code> &lt;script type="text/javascript" language="Javascript"&gt;
      function capLock(e) {
          kc = e.keyCode ? e.keyCode : e.which;
          sk = e.shiftKey ? e.shiftKey : ((kc == 16) ? true : false);
          if (((kc &gt;= 65 &amp;&amp; kc &lt;= 90) &amp;&amp; !sk) || ((kc &gt;= 97 &amp;&amp; kc &lt;= 122) &amp;&amp; sk))
              document.getElementById('divMayus').style.visibility = 'visible';
          else
              document.getElementById('divMayus').style.visibility = 'hidden';
      }
  &lt;/script&gt;
  
  &lt;input type="text" name="txtuname" /&gt;
  &lt;input type="password" name="txtPassword" onkeypress="capLock(event)" /&gt;
  &lt;div id="divMayus" style="visibility:hidden"&gt;Caps Lock is on.&lt;/div&gt; 
  </code></pre>