17 lines
528 B
JavaScript
17 lines
528 B
JavaScript
document.addEventListener('DOMContentLoaded', function() {
|
|
var headers = document.querySelectorAll('h4');
|
|
|
|
headers.forEach(function(header) {
|
|
header.addEventListener('click', function() {
|
|
var nextElement = header.nextElementSibling;
|
|
if (nextElement) {
|
|
var collapsibleList = nextElement.querySelector('.playlist, .notes, .contents');
|
|
if (collapsibleList) {
|
|
header.classList.toggle('active');
|
|
collapsibleList.classList.toggle('active');
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
|