var modal = document.getElementById("notesModal"); var modalContent = document.getElementById("noteContent"); function showModal(text, color) { modalContent.innerHTML = text; modalContent.style.backgroundColor = color; modal.style.display = "flex"; } function closeModal() { modal.style.display = "none"; } // Close the modal when clicking outside the container window.onclick = function (event) { if (event.target == modal) { modal.style.display = "none"; } }