JSFiddle - React, Tailwind, and code Playground

by Shree Khanal

HTML

<table class="bordered striped" id="Insurer_information">
                        <thead>
                        <tr>
                            <th><label style="font-weight:bold;" data-timtranslationlabel=""></label></th>
                            <th><label style="font-weight:bold;" data-timtranslationlabel="Hmilestone">Customer name</label></th>
                            <th><label style="font-weight:bold;" data-timtranslationlabel="Hmilestone">Applying credit</label></th>
                          
                        </tr>
                    </thead>
                    <tbody>
                    
                        <tr class="repeat" data-repeat="Allocation_of_group">
                            <td class="col col-1" id="section_addRemoveCopyButtons_CostTable">
                                <div class="prepend">
                                    <div class="button outline greenoutline small smaller iconDivAndTextInside Allocation_of_group_add" style="margin-right:5px;" id="itemsscheduleMilestones_add" data-callback="gadget.functions.addCallbackallocation" start="1">
                                        <div class="iconDiv addIcon">&#160;</div>
                                    </div>
                                    <div class="button outline redoutline small smaller iconDivAndTextInside Allocation_of_group_rem" style="margin-right:5px;" id="itemsscheduleMilestones_rem" data-callback="gadget.functions.removeCallbackallocation">
                                        <div class="iconDiv removeIcon">&#160;</div>
                                    </div>
                                    <div class="button outline small smaller iconDivAndTextInside Allocation_of_group_copy" style="margin-right:5px;" id="itemsscheduleMilestones_copy" data-callback="gadget.functions.copyCallbackallocation">
                                        <div class="iconDiv copyIcon">&#160;</div>
                                    </div>
              ...

JavaScript

var tableOutstandingBalanceRowCount = ($('#Insurer_information tr').length) - 2;

for (i = 0; i < tableOutstandingBalanceRowCount; i++) {

  var customernamemulti = $('[id^="customernamemulti');

  var vl = customernamemulti.val() == "" ? 1000 : 2000;

  $('[id^="Applying_credit_value').val(vl)
}