Q:

Jquery add price total after selections are made

I want to be able to click on the checkbox and the total price will change.  The prices are per day so if I add days it should calculate that for that row and that total should include that as well. 
DEMO http://jsfiddle.net/XqUH2/3/
<table id="postForm_promote">
  <tr><th>Features</th><th></th><th>Duration</th><th>Cost</th></tr>
  <tr>
    <td>
        <label for="ad_promote_highlight" style="cursor:pointer;vertical-align:top;">
            <input type="checkbox" name="ad_promote" value="1" id="ad_promote_highlight">Highlight
        </label>  
    </td>
    <td class="ad_promote_info">What's this?</td>    
    <td><input type="number" value="1" min="1" name="ad_promote_days" class="ad_promote_days"> day(s)</td>
    <td>$0.49</td>
  </tr>
  <tr>
    <td>
        <label for="ad_promote_mediumsize" style="cursor:pointer;vertical-align:top;">
            <input type="checkbox" name="ad_promote" value="2" id="ad_promote_mediumsize">Medium Size
        </label>  
    </td>
    <td class="ad_promote_info">What's this?</td> 
    <td><input type="number" value="1" min="1" name="ad_promote_days" class="ad_promote_days"> day(s)</td>
    <td>$0.99</td>
  </tr>
  <tr>
    <td>
        <label for="ad_promote_largesize" style="cursor:pointer;vertical-align:top;">
            <input type="checkbox" name="ad_promote" value="3" id="ad_promote_largesize">Large Size
        </label>  
    </td>
    <td class="ad_promote_info">What's this?</td> 
    <td><input type="number" value="1" min="1" name="ad_promote_days" class="ad_promote_days"> day(s)</td>
    <td>$1.49</td>
  </tr>
  <tr>
    <td>
        <label for="ad_promote_frontpage" style="cursor:pointer;vertical-align:top;">
            <input type="checkbox" name="ad_promote" value="4" id="ad_promote_frontpage">Front Page
        </label>  
    </td>
    <td class="ad_promote_info">What's this?</td> 
    <td><input type="number" value="1" min="1" name="ad_promote_days" class="ad_promote_days"> day(s)</td>
    <td>$2.99</td>
  </tr>
  <tr>
    <td></td><td></td><td></td>
    <td id="ad_promote_total_border"><div id="ad_promote_total_cost">$0.00</div></td>
  </tr>
</table>

All help is appreciated! 

A:

$('input[type="number"]').change(function(){

  var priceRow = $(this).parent().next();

  priceRow.text('$'+Math.round($(this).val()*priceRow.attr('unit-price')*100)/100);

  updateTotal();
});

$('input[type="checkbox"]').change(function(){

  updateTotal();

});

function updateTotal(){

  var total = 0;

  $('input[type="checkbox"]:checked').each(function(){

       var priceRow = $(this).parents('tr').children('td[unit-price]');

       total += parseFloat(priceRow.text().replace('$',''))

  })

  $('#ad_promote_total_cost').text('$'+total);
}

http://jsfiddle.net/XqUH2/7/

