Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <!-- metadata goes in head -->
- <title>Colors!!</title>
- </head>
- <body>
- <!-- content goes in the body -->
- <h1>Zmieniamy kolor tła co 2 sekundy!!</h1>
- <input id="button" type="submit" name="button" value="Biały" style="width: 5%" onclick="myFunction()"/>
- <script
- language="javascript" type="text/javascript">
- //vars
- //alert("Zmiana koloru tła, zadanie 3.");
- document.body.style.backgroundColor = "red";
- function myFunction() {
- document.getElementById("button").click();
- setInterval(function(){ document.body.style.backgroundColor = "blue"; }, 2000);
- setInterval(function(){ document.body.style.backgroundColor = "yellow"; }, 4000);
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement