title: Focus is not working in IE even after adding much delay
body: <p>This question has a reference to the solution posted here. <a href="https://stackoverflow.com/a/2600261/5086633">https://stackoverflow.com/a/2600261/5086633</a></p>
  
  <p>I am facing similar issue in IE but even after adding much delay <code>200</code> this is not working as expected in my application. The input box gets focused only intermittently, it skips to focus on the input field even after the page gets rendered in IE. I also tried calling the <code>setTimeout</code> function from  <code>$(document).ready(function(){</code> and <code>$(window).load(function() {</code> as specified below with no success. </p>
  
  <p>This code works fine when I test it locally and as a plain html file but not in my application.</p>
  
  <p>Could anyone help me fix /or provide a clue to debug/ this issue in IE, so that input field gets the focus each time the page is rendered in IE? </p>
  
  <p><em>Footnote</em>:- It is working fine in Firefox (without delay) and in Chrome small delay is required for <code>focus</code> to work. </p>
  
  <pre><code> $(document).ready(function(){
  
      setTimeout(function() { document.getElementById('testfocus').focus(); }, 200);
  
  });
  
  $(window).load(function() {
   // executes when complete page is fully loaded, including all frames, objects and images
  setTimeout(function() { document.getElementById('testfocus').focus(); }, 200);
  });
  </code></pre>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>setTimeout(function() { document.getElementById('testfocus').focus(); }, 200);</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt;
  &lt;head&gt;
  &lt;/head&gt;
  &lt;body&gt;
   
  &lt;input id="testfocus"/&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>