Line 32: | Line 32: | ||
<p2>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p2> | <p2>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p2> | ||
</div> | </div> | ||
+ | <script> | ||
+ | var coll = document.getElementsByClassName("collapsible"); | ||
+ | var i; | ||
+ | |||
+ | for (i = 0; i < coll.length; i++) { | ||
+ | coll[i].addEventListener("click", function() { | ||
+ | this.classList.toggle("active"); | ||
+ | var drop = this.nextElementSibling; | ||
+ | if (drop.style.display === "block") { | ||
+ | drop.style.display = "none"; | ||
+ | } else { | ||
+ | drop.style.display = "block"; | ||
+ | } | ||
+ | }); | ||
+ | } | ||
+ | |||
+ | |||
+ | </script> | ||
</div> | </div> |
Revision as of 11:34, 14 October 2018