title: firing all keydown/up events in contenteditable div
body: <p>my problem... I can't seem to fire all the keydown events.</p>
  
  <p>I am using an [enter] and [esc] keydown event to update/refresh or exit/refresh data in some html tables</p>
  
  <p>there are static table cells and dynamic table cells, populated based on the users search-term input</p>
  
  <p>dynamic tables come from a $.each loop but the div structures are exactly the same ( and div id's are unique ). in both cases the resulting table cell is... </p>
  
  <pre><code>&lt;td class="edit"&gt;&lt;div contenteditable="true" id="XYZ"&gt;[value]&lt;/div&gt;&lt;/td&gt;
  </code></pre>
  
  <p>the keydown functions are exactly the same....</p>
  
  <pre><code>$(document).ready(function() {
  
      $("#divA").keydown(function (e) { 
      if (e.keyCode == 13) {
          e.preventDefault();
          // send data to server          
          // refresh stuff
      } 
      if (e.keyCode == 27) {
          // refresh stuff
      }       
      });
  
      $("#divB").keydown(function (e) { 
      if (e.keyCode == 13) {
          e.preventDefault();
          // send data to server
          // refresh stuff        
      } 
      if (e.keyCode == 27) {
          // refresh stuff
      }       
      });
  </code></pre>
  
  <p>the separate functions posting date to the server are the same. and the php to update the database is the same also. and both have the same mysql data structure <code>double, yes null, zero default</code>. divB exists with data in it and <code>alert($("#divB").text());</code> shows the values that would be used in the ajax update.</p>
  
  <p>but I guess none of that matters because I have narrowed the problem to here... </p>
  
  <p>in divA, keydown stops the [enter] line-break and runs the code</p>
  
  <p>in divB, keydown does not stop the [enter] line-break and none of the code runs</p>
  
  <p>the only difference is divA is static and divB is generated in javascript. how can I get the divB keydown function to run ?</p>