title: How to hide an iframe on keydown using jquery
body: <p>I've got an iframe that I want to hide when I type ESC.  I've also got two pieces of code which I can place in <code>$(document).ready()</code>.  The first works, the second doesn't.  Seems to me that they should both hide an iframe if the ESC key is pressed in it.  What am I missing?</p>
  
  <p>Works:</p>
  
  <pre><code>$(document).keydown(function(e) {
      if ( //e.keyCode == 13 ||     // enter
          e.keyCode == 27) {     // esc
          $(document).find(".popup").hide();
      }  
  });
  </code></pre>
  
  <p>Doesn't work:</p>
  
  <pre><code>$(document).find(".popup").keydown(function(e) {
      if ( //e.keyCode == 13 ||     // enter
          e.keyCode == 27) {     // esc
          $(this).hide();
      }  
  });
  </code></pre>
  
  <p>The iframe has the class <code>popup</code>.</p>