title: sum a Ajax response in jquery
body: <p>html</p>
  
  <pre><code>&lt;tbody id="tBody"&gt;&lt;/tbody&gt;
   &lt;tfoot&gt;
     &lt;tr&gt;
       &lt;th class="text-center" colspan="9"&gt;Grand Total Payment Price&lt;/th&gt;
       &lt;th id="grand_total"&gt;&lt;/th&gt;
     &lt;/tr&gt;
  &lt;/tfoot&gt;
  </code></pre>
  
  <p>ajax </p>
  
  <pre><code>success:function(res){ 
  var bodyData = '';
   var i=1;
   var=grandTotal=0;
   $.each(res,function(index,row){ 
  bodyData+='&lt;tr id="row_'+rowCount+'" &gt;'
  .......
  +'&lt;td id="sum_'+row.id+'"&gt;'+row.discount_price_on_web+"&lt;/td&gt;&lt;td&gt;"
  ...
  bodyData+="&lt;/tr&gt;";
  }
  
   $("#tBody").append(bodyData);
  
  </code></pre>
  
  <p>my question is all the list working fine, but how can i sum the "list discount_price_on_web" and save in html id="grand_total"?</p>
  
  <p>i try this after bodyData+=""</p>
  
  <pre><code> $("[id*=sum]").each(function(){
      grandTotal=grandTotal+parseFloat($(this).html());
           });
     $("[id*=grand_total]").html(grandTotal.toString());
  </code></pre>
  
  <p>Not Working !!
  any help</p>