website-risg/output/app.js

18 lines
543 B
JavaScript
Raw Normal View History

2024-02-17 11:27:54 +01:00
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", ""));
});
}