website-risg/templates/app.js
2024-02-17 11:27:54 +01:00

18 lines
543 B
JavaScript

document.addEventListener('DOMContentLoaded', function() {
toggleSummary();
});
function toggleSummary() {
const openBtn = document.querySelector('#open-js');
const closeBtn = document.querySelector('#close-js');
const detailElements = document.querySelectorAll('detail');
openBtn.addEventListener('click', function(){
detailElements.forEach((detail) => detail.setAttribute("open", ""));
});
closeBtn.addEventListener('click', function(){
detailElements.forEach((detail) => detail.setAttribute("open", ""));
});
}