Created
September 4, 2021 07:41
-
-
Save tataranovich/e691fdf31762a6c44583fd153a0514cd to your computer and use it in GitHub Desktop.
Monitor test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Monitor test</title> | |
<script> | |
let colors = ["#ff0000", "#00ff00", "#0000ff"]; | |
let i = 0; | |
function switchcolor() { | |
document.body.style.backgroundColor = colors[i]; | |
if (i < 2) { | |
i = i + 1; | |
} else { | |
i = 0; | |
} | |
} | |
</script> | |
</head> | |
<body style="width: 100vw; height: 100vh; margin: 0" onclick="switchcolor()" onload="switchcolor()"> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment