9 lines
239 B
JavaScript
9 lines
239 B
JavaScript
var acc = document.getElementsByClassName("accordion");
|
|
var i;
|
|
|
|
for (i = 0; i < acc.length; i++) {
|
|
acc[i].onclick = function() {
|
|
this.classList.toggle("active");
|
|
this.nextElementSibling.classList.toggle("show");
|
|
}
|
|
} |