Change tab name every 3 seconds

I want to change the tab name every few seconds like it says CEO ONLY then 3 seconds later it changes it ADMIN OR CEO LOGIN. Then repeat constantly.

With javascript:

const titles = ["One", "Two", "Three"]
let index = 0

function changeTitle() {
  const title = document.querySelector("title")
  title.innerText = titles[index]
  index++
  if (index > 2) index = 0
}

setInterval(changeTitle, 3000)

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.