Toasts live in an aria-live="polite" list, so screen readers announce them without stealing focus. Hovering pauses the countdown and resumes it with the remaining time, not a fresh one. Tapping or clicking a toast dismisses it, so touch users aren't stuck waiting.
Text is set with textContent, never innerHTML, so a toast can safely show user-supplied strings.
Reuse it: call showToast('Your message', 5000) from anywhere.