pastebin

Paste Search Dynamic
Recent pastes
collapsible div
  1. var coll = document.getElementsByClassName("collapsible");
  2. var i;
  3.  
  4. for (i = 0; i < coll.length; i++) {
  5.   coll[i].addEventListener("click", function() {
  6.     this.classList.toggle("active");
  7.     var content = this.nextElementSibling;
  8.     if (content.style.maxHeight){
  9.       content.style.maxHeight = null;
  10.     } else {
  11.       content.style.maxHeight = content.scrollHeight + "px";
  12.     }
  13.   });
  14. }
Parsed in 0.003 seconds