title: Key binding on Html
body: <p>How do i bind the key W to a button on the webpage</p>
  
  <p>I try to use .keypress but it doesn't seem to work. </p>
  
  <p>Here the code : </p>
  
  <pre><code>&lt;html lang="en"&gt;
  &lt;head&gt;
    &lt;link rel="stylesheet" type="text/css" href="css/style.css" /&gt;
  &lt;/head&gt; 
  &lt;body&gt; 
      &lt;div class="d-pad"&gt;
        &lt;div id="d-up" class="button d up"&gt;&lt;/div&gt;
        &lt;div id="d-right" class="button d right"&gt;&lt;/div&gt;
        &lt;div id="d-down" class="button d down"&gt;&lt;/div&gt;
        &lt;div id="d-left" class="button d left"&gt;&lt;/div&gt;
      &lt;/div&gt;
  
  &lt;script&gt;
   $(document).keypress(function(e){                     // keybiding 
      if (e.which == 87){
          $("#d-up").click(function(){alert('UP')});
      }
   });
  &lt;/script&gt;     
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I try to bind the key W to the up button with the id = d-up and whenever W is press there will be an alert saying UP. This doesn't seem to work. Did i do something wrong here ? </p>
  
  <p>Thank you </p>