add collapsible

This commit is contained in:
ronny abraham 2025-06-13 00:41:01 +03:00
commit 26179adbf8

17
collapsible.js Normal file
View file

@ -0,0 +1,17 @@
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');
}
}
});
});
});