-3

I would like to make something where I have a bank of phrases or questions and every few seconds or every time the page is refreshed a new message is shown.

Any idea how to do this?

Barmar
  • 741,623
  • 53
  • 500
  • 612
Edward Wynman
  • 363
  • 1
  • 10
  • Which part of this are you having trouble with? Selecting a random phrase from the array, or doing it every few seconds? – Barmar Aug 20 '22 at 17:38

1 Answers1

-1
setInterval(() => {
  alert("My message");
}, 1000);

Where you replace 1000 with the number of milliseconds you want the message to repeat. 1000 milliseconds = 1 second.

Syed M. Sannan
  • 1,061
  • 2
  • 9
  • 28
  • He wants a new message each time, not the same message. – Barmar Aug 20 '22 at 17:29
  • @Barmar My bad! why is it such a problem for me to read?... anyways, from what it seems like the question is off-topic, would it be okay for me to edit the answer to help them or leave it as it is? – Syed M. Sannan Aug 20 '22 at 17:30