<script>
document.addEventListener("DOMContentLoaded", function () {
const accordions = document.querySelectorAll(".accordion button");
accordions.forEach(btn => {
btn.addEventListener("click", function () {
// Close all first
accordions.forEach(b => {
b.classList.remove("active");
b.nextElementSibling.classList.remove("open");
});
// Open this one
this.classList.add("active");
this.nextElementSibling.classList.add("open");
});
});
// Auto-open first section
if (accordions.length) {
accordions[0].click();
}
});
</script>
✅ Accordion CSS (drop into WordPress → Appearance → Customize → Additional CSS) – SolveForce Communications