title: Not getting keycode in keyup function
body: <p>I'm trying to add a keyup function to an input field which is added to DOM using jquery.</p>
  
  <pre><code>$("#testDiv").html("&lt;input id='testTextbox' name='testTextbox' type='text' onkeyup='testKeyUp(this)'&gt;");
  </code></pre>
  
  <p>I want to do some operations once user enters value in <code>testTextbox</code> and enter key is pressed.</p>
  
  <p>The keyup function is like:</p>
  
  <pre><code>function testKeyUp(e) {
  alert(e.keyCode+" : "+e.which);
  }
  </code></pre>
  
  <p>The <code>e.keyCode</code> and <code>e.which</code> is returning undefined. </p>
  
  <p>How can I get the keycode in keyup function? Can anyone help me to fix this? Thanks in advance.</p>