title: Javascript input focus
body: <p>I am trying to find some javascript that will keep an input focused when the webpage is not the active page. </p>
  
  <p>For example, I have 2 firefox windows open, one is for reading and the other has some simple counters (press the one of the input buttons and it counts).</p>
  
  <p>The annoying issue is having to click back and forth between the windows (you have to have the counter window active before you can click the button). What I am hoping will work is making the last button pressed stay focused even when the page is not active. </p>
  
  <p>This is basically what I have been trying with jquery:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script src="http://jqueryui.com/jquery-1.4.4.js"&gt;&lt;/script&gt; 
  &lt;script type="text/javascript"&gt;
  $("input.focus:last").focus();  
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;input type="button" name="counter1" size="10" class="focus" value="button1"&gt;
  &lt;input type="button" name="counter2" size="10" class="focus" value="button2"&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>