Jump to content

MCW

Members
  • Posts

    2
  • Joined

  • Last visited

MCW's Achievements

Newbie

Newbie (1/7)

0

Reputation

  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>
  2. https://www.w3schools.com/howto/howto_js_collapsible.asp Whenever I use the code modified or direct into an html, it works in Edge, Chrome and Firefox and not in IE. Any idea what would cause this? Thanks!
×
×
  • Create New...