Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<table id="consignment-table" border="1" align="center" width="500px">
<tr class="consignment-header"><th class="consignment-client">Client</th>
<th class="consignment-title">Item Name</th>
<th class="consignment-saleprice">Price Sold</th>
<th class="consignment-saleprice">Tax</th>
<th class="consignment-saleprice">Shipping</th>
<th class="consignment-saleprice">Service Fee</th>
<th class="consignment-saleprice">Commission</th>
<th class="consignment-saleprice">Due Client</th>
    <tr><td nowrap="nowrap">client a
        </td><td nowrap="nowrap">1
        </td><td class="currency PriceSold" nowrap="nowrap">
            &#36;25.75
        </td><td nowrap="nowrap">0
        </td><td class="currency" nowrap="nowrap">0
        </td><td nowrap="nowrap">0
        </td><td nowrap="nowrap">0
        </td><td class="currency" nowrap="nowrap">0
    </td></tr>
    <tr><td nowrap="nowrap">client b
        </td><td nowrap="nowrap">2
        </td><td class="currency PriceSold" nowrap="nowrap">
            &#36;31.44
        </td><td nowrap="nowrap">0
        </td><td class="currency" nowrap="nowrap">0
        </td><td nowrap="nowrap">0
        </td><td nowrap="nowrap">0
        </td><td class="currency" nowrap="nowrap">0
    </td></tr>
    <tr><td nowrap="nowrap">client a
        </td><td nowrap="nowrap">3
        </td><td class="currency PriceSold" nowrap="nowrap">
            &#36;15.92
        </td><td nowrap="nowrap">0
        </td><td class="currency" nowrap="nowrap">0
        </td><td nowrap="nowrap">0
        </td><td nowrap="nowrap">0
        </td><td class="currency" nowrap="nowrap">0
    </td></tr>
    <tr><td nowrap="nowrap">total:
        </td><td nowrap="nowrap">
        </td><td class="currency total1" nowrap="nowrap">
        </td><td nowrap="nowrap">
        </td><td class="currency" nowrap="nowrap">
        </td><td nowrap="nowrap">
        </td><td nowrap="nowrap">
        </td><td class="currency" nowrap="nowrap">
    </td></tr>
</table>
  
<script>
$(document).ready(function(){
  var total1 = 0.0;
  $('.PriceSold').each(function(){
    try{
      total1 += $(this).html().replace('$','') * 1;
    } catch(ex){}
  });
  $('.total1').html('<b>$' + total1+ '</b>');
});
</script>  
  
</body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers