</> ConvertAtlas Developer Tools
Bootstrap 5 · Intermediate

Custom FAQ Accordion

A single-open FAQ accordion with plus/minus toggles in pure JS.

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:380px"><div class="card-body" id="afWrap">
  <div class="border-bottom"><button class="btn w-100 text-start fw-semibold d-flex justify-content-between py-3" data-af>What is your refund policy?<span>+</span></button><div class="small text-secondary pb-3" style="display:none">30-day money-back guarantee, no questions asked.</div></div>
  <div class="border-bottom"><button class="btn w-100 text-start fw-semibold d-flex justify-content-between py-3" data-af>Do you offer support?<span>+</span></button><div class="small text-secondary pb-3" style="display:none">Yes, priority email support on all paid plans.</div></div>
  <div><button class="btn w-100 text-start fw-semibold d-flex justify-content-between py-3" data-af>Can I cancel anytime?<span>+</span></button><div class="small text-secondary pb-3" style="display:none">Absolutely, cancel from your dashboard instantly.</div></div>
</div></div>
document.querySelectorAll('#afWrap [data-af]').forEach(function(b){b.onclick=function(){var p=b.nextElementSibling,open=p.style.display==='none';document.querySelectorAll('#afWrap [data-af]').forEach(function(x){x.nextElementSibling.style.display='none';x.querySelector('span').textContent='+'});if(open){p.style.display='block';b.querySelector('span').textContent='−'}}});
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.