diff --git a/output/app.js b/output/app.js index a21c7df..df7f187 100644 --- a/output/app.js +++ b/output/app.js @@ -3,15 +3,15 @@ document.addEventListener('DOMContentLoaded', function() { }); function toggleSummary() { - const openBtn = document.querySelector('#open-js'); - const closeBtn = document.querySelector('#close-js'); - const detailElements = document.querySelectorAll('detail'); + const openBtn = document.querySelector('.open-js'); + const closeBtn = document.querySelector('.close-js'); + const detailElements = document.querySelectorAll('details'); openBtn.addEventListener('click', function(){ detailElements.forEach((detail) => detail.setAttribute("open", "")); }); closeBtn.addEventListener('click', function(){ - detailElements.forEach((detail) => detail.setAttribute("open", "")); + detailElements.forEach((detail) => detail.removeAttribute("open", "")); }); } diff --git a/templates/app.js b/templates/app.js index a21c7df..df7f187 100644 --- a/templates/app.js +++ b/templates/app.js @@ -3,15 +3,15 @@ document.addEventListener('DOMContentLoaded', function() { }); function toggleSummary() { - const openBtn = document.querySelector('#open-js'); - const closeBtn = document.querySelector('#close-js'); - const detailElements = document.querySelectorAll('detail'); + const openBtn = document.querySelector('.open-js'); + const closeBtn = document.querySelector('.close-js'); + const detailElements = document.querySelectorAll('details'); openBtn.addEventListener('click', function(){ detailElements.forEach((detail) => detail.setAttribute("open", "")); }); closeBtn.addEventListener('click', function(){ - detailElements.forEach((detail) => detail.setAttribute("open", "")); + detailElements.forEach((detail) => detail.removeAttribute("open", "")); }); }