title: How to always focus keep focus in text box
body: <p>I have created a single HTML page that contains two divs. The div on the left (90% of page) is the target for ajax results. The div on the right (10% of page) contains a single text box. </p>
  
  <p>The idea for the page is to enter a part number to the text box (via a barcode scanner) and display the drawing which matches that part number, show up in the left div. </p>
  
  <p>I have all of that working. No problems there.</p>
  
  <p>What I can't figure out, is how to return the focus to the textbox after the drawing loads. </p>
  
  <p>The drawing is being loaded as an object, like this:</p>
  
  <pre><code>&lt;div id="viz"&gt;
        &lt;object classid="clsid:A662DA7E-CCB7-4743-B71A-D817F6D575DF" width="640" height="480"&gt;
           &lt;param name="src" value="name_of_file.dwf" /&gt;
           &lt;param name="wmode" value="transparent" /&gt;
           &lt;param name="UserInterfaceEnabled" value="false" /&gt;
           &lt;param name="NavigatorDocked" value="true" /&gt;
           &lt;param name="ToolbarVisible" value="false" /&gt;
           &lt;embed width="100%" height="100%" wmode="transparent" src="&lt;?php echo $drawingfullpath;?&gt;" &gt;&lt;/embed&gt;
        &lt;/object&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>(For anyone keeping score, that object is Autodesk DWF viewer. it acts a lot like flash, but doesn't accept all of the same parameters). </p>
  
  <p>What is the best way to always keep focus in the text box? Because the operator will be using a barcode scanner, I'd rather not have them require a mouse to click back into the text box if focus is lost. </p>
  
  <p>I would prefer to not use jquery, as it seems like overkill for such a simple request. HOWEVER, if jquery is the <em>only</em> way to accomplish this, then that's fine.</p>
  
  <hr>
  
  <h2>update</h2>
  
  <p>fiddle (<a href="http://jsfiddle.net/g9YxB/7/" rel="nofollow">http://jsfiddle.net/g9YxB/7/</a>) has been updated with the latest suggestion from @subin. </p>
  
  <p>The focus is still lost once the object loads. HOWEVER, if you click away from the page and then click back, the focus is where it belongs (in the text box). That has to be a clue, right?</p>