JSFiddle - React, Tailwind, and code Playground

HTML

<input type="checkbox" value="3.99" id="one" checked>
<input type="checkbox" value="5.99" id="two">
<input type="checkbox" value="7.99" id="three">

<div id="total">3.99</div>

JavaScript

$("input[type=checkbox]").change(function(){
    updateTotal();
});

function updateTotal(){
    var total = 0;
    $("input[type=checkbox]:checked").each(function(){
        total += parseFloat($(this).val());
    });
    $("#total").html(total);
}