$(document).ready(function() { let c = document.getElementsByClassName("collapsible"); for (let i = 0; i < c.length; i++) { c[i].addEventListener("click", function() { this.classList.toggle("button-outline"); var content = this.nextElementSibling; if (content.style.display === "block") { content.style.display = "none"; } else { content.style.display = "block"; } }); } });