Try to search your question here, if you can't find : Ask Any Question Now ?

SyntaxError: Unexpected identifier: unspecified error

HomeCategory: stackoverflowSyntaxError: Unexpected identifier: unspecified error
Avatarjulie asked 5 months ago

so basically like i made a javascript code so it animates the webpage title but it keeps saying SyntaxError: Unexpected identifier and i tried things like while loops and for loops infinite but it still says SyntaxError: Unexpected identifier.

i’ve tried using for loops and while loops, different functions are variables but none work.

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <link href="style.css" rel="stylesheet"  />
    <style>
      .button {
        color:white;
        background-color:green;
        padding:10px 10px;
        cursor: pointer;
      }
      .button:hover {
        background-color:darkgreen;
      }
      .button:active {
        cursor: crosshair;
      }
    </style>
  </head>
  <body>
    <title id="dude">welcome</title>
    <script src="script.js"></script>
    <h1>welcome<h1>
    <button id ="doo" class="button" onclick="dingwun()">click me!</button>
    <h2>click the thing to reveal:</h2>
    <p style="background-color:black"><font color=red id="vari"></font></p>
    <script>
    function dingwun() {
      document.getElementById("vari").innerHTML = "coolio";
      setInterval(function() {document.getElementById("vari").innerHTML = "";},3000)
    }
    </script>
    <script>
      while (i = true) {
        document:getElementById("dude")innerHTML = "w";
        setInterval(function() {document:getElementById("dude")innerHTML = "we";},1000);
        setInterval(function() {document:getElementById("dude")innerHTML = "wel";},1000);
        setInterval(function() {document:getElementById("dude")innerHTML = "welc";},1000);
        setInterval(function() {document:getElementById("dude")innerHTML = "welco";},1000);
        setInterval(function() {document:getElementById("dude")innerHTML = "welcom";},1000);
        setInterval(function() {document:getElementById("dude")innerHTML = "welcome";},1000);
        setInterval(function() {document:getElementById("dude")innerHTML = "welcom";},1000);
        setInterval(function() {document:getElementById("dude")innerHTML = "welco";},1000);
        setInterval(function() {document:getElementById("dude")innerHTML = "welc";},1000);
        setInterval(function() {document:getElementById("dude")innerHTML = "wel";},1000);
        setInterval(function() {document:getElementById("dude")innerHTML = "we";},1000);
        setInterval(function() {document:getElementById("dude")innerHTML = "w";},1000);
      }
    </script>
  </body>
</html>

my expected result was that it would have an infinite loop of changing the webpage title to w we wel welc welco welcom welcome then go back

1 Answers
Best Answer
AvatarMikhail answered 5 months ago
Your Answer

15 + 11 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com