title: NaN in javascript showing up when using a text input field to sum
body: <p>I need to sum a value with another one that comes from input text.</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;%= f.text_field :hoursclass, id:"txt_hours" %&gt;     
  </code></pre>
  
  <p>JS</p>
  
  <pre><code>$(function() {
    var price = &lt;%= @room.price %&gt;;
    var qtdhours =  parseInt($(':input[id="txt_hours"]').val());
    var total = qtdhours * &lt;%= @room.price %&gt;
  
    $("#txt_hours").keyup(function() { 
      $('#reservation_days').text(qtdhours);
      $('#reservation_sum').text(total);
   });
  </code></pre>
  
  <p><code>$('#reservation_sum').text(total);</code> returns NaN</p>
  
  <p>Tks in advance</p>