title: setting focus to first cell of table using html/javascript
body: <p>i have table with 3X4 cells i navigate among cells using arrow keys(right,left,up, down) but problem is initially i need to press tab key to get focus to first cell and only after that i will be able to use arrow key to navigate. now my question is how can i set focus to first cell of table so that i can directly use arrow keys to navigate instead use tab first and they arrow keys.</p>
  
  <p>here is my code:</p>
  
  <pre><code>function myNav(e,down,left,up,right)
     {
      if (!e) e=window.event;
      var selectArrowKey;
      switch(e.keyCode)
      {
       case 37:
  
       selectArrowKey = left;
       break;
       case 38:
  
       selectArrowKey = down;
       break;
       case 39:
  
       selectArrowKey = right;
       break;
       case 40:
  
       selectArrowKey = up;
       break;
      }
      if (!selectArrowKey) return;
      var controls = document.getElementsByName(selectArrowKey);
      if (!controls) return;
      if (controls.length != 1) return;
      controls[0].focus();
     }  
  </code></pre>
  
  <p>kindly help.</p>