title: Javascript .focus issue in IE for dynamic content
body: <p>Javascript syntax </p>
  
  <p><code>for(i in x)
  {
     x[i].focus();
  }</code></p>
  
  <p>This works properly in Mozilla and Chrome but gives error in IE.</p>
  
  <p>Error displayed is</p>
  
  <p>Message: Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus.</p>
  
  <p>I tried using try catch block as below</p>
  
  <p><code>for(i in x)
  {
       try { x[i].focus();  }
       catch(err){   }
  }</code></p>
  
  <p>It worked properly, but My system has more than 100 pages and dont know how many times i have used .focus</p>
  
  <p>Kindly help me get rid of this IE problem.</p>