function showToast(message, duration) { // Create a new div element for the toast message const toast = document.createElement('div'); toast.classList.add('toast'); // Add the message content to the toast toast.innerHTML = message; // Add the toast to the container element const container = document.getElementById('toast-container'); container.appendChild(toast); // Use a timer to remove the toast after the specified duration setTimeout(() => { container.removeChild(toast); }, duration); }