title: Object doesn't support property or method "focus"
body: <p>I am using the <code>tagsinput</code> text field on my website from this <a href="http://www.xoxco.com/projects/code/tagsinput" rel="nofollow">project</a>.</p>
  
  <p>And I am trying to set focus to the text field but it isn't working. It is giving me the following error:</p>
  
  <pre><code>Unhandled exception at line 37, column 9 in
  LOCALDOMAIN-LINK-REMOVED
  0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'focus'.
  </code></pre>
  
  <p>The <code>line (37)</code> that this error is referring to is:</p>
  
  <pre><code>searchQueryTB.focus();
  </code></pre>
  
  <p>My full code is:</p>
  
  <pre><code>document.onload = FocusSearchQueryTextBox();
  
  function FocusSearchQueryTextBox() {
      var searchQueryTB = document.getElementsByClassName("TBhandle0F7X");
      searchQueryTB.focus();
  }
  </code></pre>
  
  <p>Markup:</p>
  
  <pre><code>&lt;input type="text" value="" name="SearchQuery" id="tagsinput" class="TBhandle0F7X" /&gt;
  </code></pre>
  
  <p>So I'm assuming it may have something to do with the fact that maybe the text field isn't actually a proper <code>textfield</code> in that it's a jQuery UI one or something that's used by <code>tagsinput</code> project? Or maybe I'm wrong, but I haven't had any luck thus far on Google and there doesn't appear to be anything related to this issue on the project's website.</p>
  
  <p>I've also tried this in jQuery, but as expected, it didn't work either. Same error.</p>
  
  <p>Any suggestions as to what is wrong or how I could fix this?</p>