title: document.getElementById().focus() not working on Google Chrome
body: <p>I'm trying to use the focus() function to focus on a parent window after clicking on a link that runs a function. The code I have works in IE, but it doesn't work in Chrome for some reason.</p>
  
  <p>Here is the HTML with the function (moveToNext(var1,var2)):</p>
  
  <pre><code>&lt;td style="border-left: solid 1px #000000;border-bottom: solid 1px #000000;" nowrap=""&gt;
      &lt;a href="javascript:moveToNext('xxxxxxxxxxxx','null')"&gt;xxxxxxxxxxxx&lt;/a&gt;
  &lt;/td&gt;
  </code></pre>
  
  <p>Here is the code in the function:</p>
  
  <pre><code>function moveToNext(var1,var2){
      ...
      // Other code to set form.action
      ...
  
      window.opener.document.forms[0].submit();
      window.opener.document.getElementById('elementid').focus();
      return;
  }
  </code></pre>
  
  <p>I also saw this question,
  <a href="https://stackoverflow.com/questions/1096436/document-getelementbyidid-focus-is-not-working-for-firefox-or-chrome">document.getElementById(id).focus() is not working for firefox or chrome</a>,
  but this didn't work for me below:</p>
  
  <pre><code>window.opener.document.forms[0].submit();
  window.setTimeout(function() {
      window.opener.document.getElementById('elementid').focus();
  }, 0);
  </code></pre>
  
  <p>The function is working in Chrome because the form is being submitted, the focus() just isn't working.</p>
  
  <p>Anybody know how to fix this or have any suggestions?</p>