Bundle Builder
A checkbox bundle whose total recalculates as items toggle.
Requires Bootstrap 5. Add the CDN tags below to your page (styles in
<head>, scripts before </body>). The downloaded file already includes them.<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"><script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script><div class="card border-0 shadow-sm" style="max-width:360px"><div class="card-body">
<h6 class="fw-bold mb-2">Bundle & save</h6>
<label class="d-flex justify-content-between align-items-center border rounded p-2 mb-2"><span class="small"><input type="checkbox" class="bd-i me-1" data-p="129" checked> Headphones</span><span class="small fw-semibold">$129</span></label>
<label class="d-flex justify-content-between align-items-center border rounded p-2 mb-2"><span class="small"><input type="checkbox" class="bd-i me-1" data-p="49" checked> Case</span><span class="small fw-semibold">$49</span></label>
<label class="d-flex justify-content-between align-items-center border rounded p-2 mb-2"><span class="small"><input type="checkbox" class="bd-i me-1" data-p="29"> Warranty</span><span class="small fw-semibold">$29</span></label>
<div class="d-flex justify-content-between fw-bold"><span>Total</span><span id="bdTotal">$178</span></div>
</div></div>var boxes=document.querySelectorAll('.bd-i');
function upd(){var t=0;boxes.forEach(function(b){if(b.checked)t+=+b.dataset.p});document.getElementById('bdTotal').textContent='$'+t}
boxes.forEach(function(b){b.onchange=upd});upd();Free to use.This component uses Bootstrap 5 (linked above). Copy any file, or download a ready-to-open .html page with the CDN links already included.