-2

I am creating a website, and I need to display different messages each time. I used <blink> tags in HTML.

With <blink> we can only make one text blink.

Cœur
  • 34,719
  • 24
  • 185
  • 251

1 Answers1

1

var messages = ["OK, I admit...", "...that I only answered this...", "...because I was curious to see...", "...if it could be done in one line...", "...which apparently it can...", "...though it is silly to do so..."];

setInterval(((i =-1, m = document.getElementById("message")) => () => m.innerHTML = m.innerHTML==="" ? messages[i=(i+1)%messages.length] : "")(), 1000);
<p id="message"></p>
nnnnnn
  • 143,356
  • 28
  • 190
  • 232