title: Jquery - Set focus to window
body: <p>any ideas why this not work?</p>
  
  <pre><code>$(document).ready(function ubsrt()
  {
      $(window).bind('keyup', function(e) { if (e.keyCode == '27') 
      { 
          $('body').append('focus window &lt;br /&gt;');
          $(window).focus(); 
          $(document).focus(); 
      } });
  
     $('#test').focus();
  
  });
  </code></pre>
  
  <p><strong>example</strong><br />
  <a href="http://jsbin.com/agayen/edit#preview" rel="nofollow">http://jsbin.com/agayen/edit#preview</a></p>