diff --git a/scripts.js b/scripts.js index 33c70cc..d233742 100644 --- a/scripts.js +++ b/scripts.js @@ -235,4 +235,20 @@ function renderSavedPasswords() { document.addEventListener('DOMContentLoaded', async function () { await loadSavedPasswords(); generatePassword(); +}); + +document.addEventListener('DOMContentLoaded', function() { + const dropdownBtns = document.querySelectorAll('.dropdown-btn'); + + dropdownBtns.forEach(btn => { + btn.addEventListener('click', function() { + this.classList.toggle('active'); + const content = this.nextElementSibling; + if (content.style.display === "block") { + content.style.display = "none"; + } else { + content.style.display = "block"; + } + }); + }); }); \ No newline at end of file