document.addEventListener("DOMContentLoaded", function () { const button = document.getElementById('dropdown-button'); const dropdown = document.getElementById('dropdown-content'); button.addEventListener('click', function () { if (dropdown.style.display === 'none' || dropdown.style.display === '') { dropdown.style.display = 'block'; } else { dropdown.style.display = 'none'; } }); // Optional: Close the dropdown if clicking outside document.addEventListener('click', function (event) { if (!button.contains(event.target) && !dropdown.contains(event.target)) { dropdown.style.display = 'none'; } }); });