jeudi 14 juillet 2016

How to create an element show and hide using localStorage with timeout

I am fairly new to Javascript and I would like to create the following for example:

enter image description here

Basically, I am trying to get a custom content that can be closed by the user when needed. I heard that this can be done using localStorage with a timeout period.

Once the user clicks the close button, it stays hidden in the DOM until the timer expires, say 2-3 days and then re-appear again in the page.

How do I go about doing it?

Would appreciate some help on this.

Thanks

Aucun commentaire:

Enregistrer un commentaire