 <p>I have face the same issue before but I do not understand that why this occur.But I have solve it by declaring variable using $ sign instead of var.</p> <pre><code> $('#numberOfItems').keyup(function(){ $items = $('#numberOfItems').val(); $weightitem = $('#weightitem').val(); $totalweight = $items * $weightitem; $('#totalweight').val($totalweight); }); </code></pre>