-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
  • 37,241
  • 25
  • 195
  • 267

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
  • 147,572
  • 30
  • 200
  • 241