const wrapper = document.querySelector(".notifications"); const toast = (message, type) => { const notification = document.createElement("div"); notification.innerHTML = `

${type}

${message}

`; notification.classList.add(...["notification", type]); wrapper.appendChild(notification); setTimeout(() => { notification.remove(); }, 10000); };