title: get value of dynamic textbox in datatable and compute new value upon keypress
body: <p>This is a take off from the following solved questions (so please don't tag this as duplicate):</p>
  
  <ol>
  <li><p><a href="https://stackoverflow.com/questions/42857450/jquery-access-value-of-a-textbox-in-datatable">jquery: access value of a textbox in datatable</a></p></li>
  <li><p><a href="https://stackoverflow.com/questions/203198/event-binding-on-dynamically-created-elements">Event binding on dynamically created elements?</a></p></li>
  </ol>
  
  <p>I created a dynamic textbox in a datatable. Now, I need to access that value to compute a new value upon keypress. While I find the answers on (<a href="https://stackoverflow.com/questions/203198/event-binding-on-dynamically-created-elements">Event binding on dynamically created elements?</a>) extremely useful, I am still at lost how to get value of the textbox. </p>
  
  <p>The "keyup change" function is already triggered since I am getting the alert. However, I am getting a 'NaN' (not a number) value. Please help!</p>
  
  <p>this is my code:</p>
  
  <pre><code>var xindex;
  var yindex;
  
   $(document).on('mouseover', '#table1 tr', function() {
       xindex = this;
       yindex = this.rowIndex;
   });
  
  
   var dtable = $('#table1').DataTable();
   var origval = $('#table1 tr:eq(' + parseInt(yindex) + ') &gt;td:eq(' + 1 + ')').html(); 
  //this is the original value in which I would like to add the adjustment
   var textvalue = $(yindex).find(".txtval");
     //upon creating the datatable dynamically, the class of the input textbox is "txtval"
   var newval;
  
   $(document).on('keypress', '.textvalue', function(e) {
      if (e.which != 8 &amp;&amp; e.which !=0 &amp;&amp; (e.which &lt; 48 || e.which &gt; 57)){
          e.stopImmediatePropagation();
  
      return false;
      }
  
  
      }).on('keyup change', function(e) {
  
          newval = origval + this.value;
          alert(newval);
   });
  </code></pre>