Calculate and display value in the last td
<p>Goal:<br>
Calculate and display right answer in the last td in the tr by selecting row(s). For instance, if I choose the second row, I would get value 44 and it should be applied in the last td of the row.</p>

<p>Problem:<br>
I know how to do it in javascript but in jQuery.</p>

<p>Need help with the source code in jQuery.</p>

<p>// fullmetalboy</p>

<hr>

<pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;

&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt;
    &lt;head&gt;
        &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"/&gt;

        &lt;title&gt;index&lt;/title&gt;

    &lt;SCRIPT language="javascript"&gt;
        function addRow(tableID) {

            var table = document.getElementById(tableID);

            var rowCount = table.rows.length;
            var row = table.insertRow(rowCount);

            var cell1 = row.insertCell(0);
            var element1 = document.createElement("input");
            element1.type = "checkbox";
            cell1.appendChild(element1);

            var cell2 = row.insertCell(1);
            cell2.innerHTML = rowCount + 1;

            var cell3 = row.insertCell(2);
            cell3.innerHTML = "22";

            var cell4 = row.insertCell(3);
            cell4.innerHTML = "";


        }

        function deleteRow(tableID) {
            try {
            var table = document.getElementById(tableID);
            var rowCount = table.rows.length;

            for(var i=0; i&lt;rowCount; i++) 
            {
                var row = table.rows[i];
                var chkbox = row.cells[0].childNodes[0];

                if(null != chkbox &amp;&amp; true == chkbox.checked) 
                {
                    var sdf = 23;


                    //table.deleteRow(i);
                    //rowCount--;
                    //i--;
                }

            }
            }catch(e) {
                alert(e);
            }
        }

    &lt;/SCRIPT&gt;


    &lt;/head&gt;

    &lt;body&gt;

    &lt;INPUT type="button" value="Add Row" onclick="addRow('dataTable')" /&gt;

    &lt;INPUT type="button" value="Calculate selected row" onclick="deleteRow('dataTable')" /&gt;

    &lt;TABLE id="dataTable" width="350px" border="1"&gt;
        &lt;TR&gt;
            &lt;TD&gt;&lt;INPUT type="checkbox" name="chk"/&gt;&lt;/TD&gt;
            &lt;TD&gt;1&lt;/TD&gt;
            &lt;TD&gt;22&lt;/TD&gt;
            &lt;TD&gt;&lt;/TD&gt;            
        &lt;/TR&gt;
    &lt;/TABLE&gt;        



    &lt;/body&gt;
&lt;/html&gt;
</code></pre>
