marcelodolza / iziToast

Elegant, responsive, flexible and lightweight notification plugin with no dependencies.

Home Page:http://izitoast.marcelodolza.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dynamic message

AndrewPixel opened this issue · comments

I have a toast that is displayed for a relatively long time so I'd liked to periodically change the message. After the toast is displayed. I tried this:

let iziTxt = document.querySelector('.iziToast-message.slideIn');
iziTxt.innerHTML = "Still working...";

but the message didn't change. How can I change the message dynamically?

How do you create a toast? Do you store toasts as objects in some array?

Sorry, after checking it numerous times I found that the toast I created and subsequently destroyed before displaying the current toast was being referenced. I added an ID to the current toast and I was able to reference (and change) the message correctly.