Jump to content

MCW

Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by MCW

  1. I am pretty new to this, or several years removed being more like it.  I replaced toggle with contains.  How else would I change this.  Thanks!

     

    <script>
    var coll = document.getElementsByClassName("collapsible");
    var i;

    for (i = 0; i < coll.length; i++) {
      coll.addEventListener("click", function() {
        this.classList.contains("active");
        var content = this.nextElementSibling;
        if (content.style.display === "block") {
          content.style.display = "none";
        } else {
          content.style.display = "block";
        }
      });
    }
    </script>

×
×
  • Create New...