title: How to calculate the sum of dynamically column with jquery
body: <p>I've been create a table row with jquery, the column id is the id of data that have been selected. How can i calculate the sum of 'total_price' column which the id is dynamically (based on data id) ?</p>
  
  <p><a href="https://i.stack.imgur.com/OMvRa.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OMvRa.jpg" alt="enter image description here"></a></p>
  
  <p>here my jquery script</p>
  
  <pre><code>function getCorporateService(id){
      //get data and parsing to column
      $.get("{{ url('salesorder/service')}}/"+id, function(data){
          console.log(id);
          console.log(data);
          $.each(data, function (index, element){
  
              $br = "&lt;tr id='item'&gt;";
              $br += "&lt;td&gt; &lt;input class='input-small' type='text' id='order_identifier' name='order_identifier' readonly&gt;&lt;/td&gt;";
              $br += "&lt;td&gt;&lt;input class='input-small' type='text' id='service["+id+"]' name='service["+id+"]' value='"+element.service_name+"' readonly&gt;&lt;/td&gt;";
              $br += "&lt;td&gt;&lt;select id='order_type["+id+"]' name='order_type["+id+"]'&gt; &lt;option&gt; - &lt;/option&gt; &lt;option value='add'&gt;Add&lt;/option&gt; &lt;option value='change'&gt;Change&lt;/option&gt; &lt;option value='cancel'&gt;Cancel&lt;/option&gt; &lt;/select&gt;&lt;/td&gt;";
              $br += "&lt;td&gt;&lt;input class='input-small' type='text' id='select_plan["+id+"]' name='select_plan["+id+"]'&gt;&lt;/td&gt;";
              $br += "&lt;td&gt;&lt;input class='input-mini' type='text' id='qty["+id+"]' name='qty["+id+"]' value='1' onChange='getTotalPrice("+id+")'&gt;&lt;/td&gt;";
              $br += "&lt;td&gt;&lt;input class='input-small' type='text' id='unit_price["+id+"]' name='unit_price["+id+"]' onChange='getTotalPrice("+id+")'&gt;&lt;/td&gt;";
              $br += "&lt;td&gt;&lt;input class='input-small' type='text' id='total_price["+id+"]' name='total_price["+id+"]' onChange='getTotalPrice("+id+")'&gt;&lt;/td&gt;";
              $br += "&lt;td&gt;&lt;textarea class='input-small' id='notes["+id+"]' name='notes["+id+"]'&gt;&lt;/textarea&gt;&lt;/td&gt;";
              $br += "&lt;/tr&gt;";
  
              $(".corporatesvc").append($br);
          });
      });
  }
  </code></pre>