JSFiddle - React, Tailwind, and code Playground

by jackwanders

HTML

<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<div>$<span id="price">0.00</span></div>

JavaScript

$(':checkbox').change( function(){
    var sum = $(':checked').length
        $('#price').html((sum*1.99).toFixed(2));
})