title: How to call JQuery function when blur or press enter?
body: <p>I need to release the textfield when I press enter or blur()</p>
  
  <p>Actually I'm ok when blur(), but I need those both things.</p>
  
  <p>This is what I have:</p>
  
  <p><strong>* JQuery *</strong></p>
  
  <pre><code>$(document).ready(theMain);
        function theMain(){
  
          $("td").blur(ActTable);
  
          function ActTable(){
            alert("it works!");
          }
  
      }
  </code></pre>
  
  <p><strong>* HTML *</strong></p>
  
  <pre><code>&lt;table&gt;
    &lt;tr&gt;&lt;td&gt;myID&lt;/td&gt;&lt;td&gt;column1&lt;/td&gt;&lt;td&gt;column2&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;01&lt;/td&gt;
      &lt;td contenteditable="true" onkeyup="if(event.keyCode==13) ActTable();"&gt;text to change&lt;/td&gt;
      &lt;td contenteditable="true" onkeyup="if(event.keyCode==13) ActTable();"&gt;text to change&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>In fact, this HTML part calls the function but I need to release the textfield instead of type down space. Same as blur() does.</p>
  
  <p>Sorry for my bad english and thanks.</p>
  
  <p><strong>Edit:</strong> 
  I need to release the text field when I press enter, i don't know if i'm speaking correctly but I need the same blur effect when I press enter on that textfield. English is not my native language so, sorry if i'm not speaking well.</p>