How do I change the title of the browser tab repeatedly?

Asked

Viewed 33 times

-1

<html lang="pt-br">
<head>
    <meta charset="UTF-8">
    <link href="https://fonts.googleapis.com/css?family=Orbitron" rel="stylesheet">
    <script src="http://yourjavascript.com/31014130009/title.js"></script>
    <link rel="icon" a href="https://is.gd/DhDDsG">
<style>
* {
    margin: 0px;
    padding: 0px;
}
body {
    background-image: url(https://i0.wp.com/media.giphy.com/media/10Hmp1WdHaHmDe/giphy.gif?w=1280&ssl=1);
    background-repeat: no-repeat;
    background-size: 100%;
}
.div-title {
    margin-top: 15px;
}
.label-1 {
    font-family:"Orbitron", sans-serif;
    font-size: 27px;
    color: cyan;
}
</style>
</head>
<body onmousedown="return false" onkeydown="return false">
    <div class="div-title">
        <center><label class="label-1">- 0wn3d bY 0xyrh0pus 777 - ^^</label></center>
    </div>
</body>
</html>

2 answers

1

function alternateTitle (...titles) {
  let currentIndex = 0;
  return setInterval(() => {
    if (currentIndex === titles.length) {
      currentIndex = 0
    }

    document.title = titles[currentIndex++]
  }, 1000)
}

alternateTitle("Aqui", "Você pode", "Escrever", "Várias", "Mensagens")

  • I don’t think it even needs to be a function...

-1

You can do this by javascript:

document.title = "Novo título";

Browser other questions tagged

You are not signed in. Login or sign up in order to post.