jQuery - Get cell values and update cell values with result
<p>I'm working on a simple jQuery function that will grab the values of some input fields from 2 cells from a table and then perform some simple math to work out the difference, then update another cell value with the difference.</p>

<p>Here's my function:</p>

<pre><code>$(document).ready(function(){

    $('#Calculate').click(function(){

    var nextYearTotal = $("#textfield6").text();
    var lastYearTotal = $("#textfield1").text();

    nextYearTotal = Number(nextYearTotal);
    lastYearTotal = Number(lastYearTotal);

    var updatedTotal = nextYearTotal - lastYearTotal;

    $('#textfield7').html(updatedTotal);
    });
});
</code></pre>

<p>No matter what the values in the textfield6 and textfield1 input fields are I'm getting "0" as the result in the textfield7 cell. </p>

<p>I'm new to jQuery - would greatly appreciate it if someone can point out my error. This function is called when I click a button in a row of the table.</p>
