var btns = document.querySelectorAll('.accordion');
btns.forEach(function(btn){
btn.addEventListener('click', function(){
this.classList.toggle('active');
var pannel = this.nextElementSibiling;
if(pannel.style.maxheight){
pannel.style.maxheight = null;
} else {
pannel.style.maxheight = pannel.scrollheight + "px";
}
})
})