commit 26179adbf871c7bdc22c332c23dd4c047c4f5104 Author: ronny abraham Date: Fri Jun 13 00:41:01 2025 +0300 add collapsible diff --git a/collapsible.js b/collapsible.js new file mode 100644 index 0000000..ded1a8a --- /dev/null +++ b/collapsible.js @@ -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'); + } + } + }); + }); +}); +