title: Jquery esc hide method not hiding the elements
body: <p>I was making a light box gallery but this code doesn't hide the lightbox <code>div</code> which was supposed to be hidden when I press the <em>esc</em> key.</p>
  
  <pre><code>$(document).keyup(function(e) {
      if(e.keyCode==27) {
          $("#lightbox").hide();
      }
  });
  </code></pre>
  
  <p>I have my DOM elements like this:</p>
  
  <pre><code>&lt;div id="lightbox"&gt;
      &lt;div id="overlay"&gt;
          &lt;div id="imageholder"&gt;
              &lt;img name="lightboximage" src="images/demo/940x340.gif" height="600" width="700" align="left" /&gt;
              &lt;div id="description"&gt;
                  &lt;h1&gt;&lt;a href="url/cyberkiller.nishchal"&gt;Nishchal Gautam&lt;/a&gt;&lt;/h1&gt;
                  &lt;p&gt;Description about the image&lt;/p&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I have placed the script below these elements, am I missing something?</p>