For Advertisements on this blog Contact Us at developgram@gmail.com or +91-9923438816

Simple Programming Tutorials For Beginners

Tuesday, April 18, 2017

Change Body Color (Every 5 Seconds)

<html>
<body>
  <script>
    function violet()
    {
      document.body.style.background = "violet"
      setTimeout("indigo()", 5000);
    }

    function indigo()
    {
      document.body.style.background = "indigo"
      setTimeout("blue()", 5000);
    }

    function blue()
    {
      document.body.style.background = "blue"
      setTimeout("green()", 5000);
    }

    function green()
    {
      document.body.style.background = "green"
      setTimeout("yellow()", 5000);
    }

    function yellow()
    {
      document.body.style.background = "yellow"
      setTimeout("orange()", 5000);
    }

    function orange()
    {
      document.body.style.background = "orange"
      setTimeout("red()", 5000);
    }

    function red()
    {
      document.body.style.background = "red"
      setTimeout("violet()", 5000);
    }

    violet();
  </script>
</body>
</html>

No comments:

Post a Comment

SEARCH THIS BLOG