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">0</div>

JavaScript

$('input:checkbox').on('change', function () {

    if(this.checked)
    $('#total').text(parseFloat($('#total').text()) + parseFloat($(this).val()))

}).trigger("change")