Created
June 15, 2015 17:44
-
-
Save afonsomatos/77e0d6fafc4a628da71a to your computer and use it in GitHub Desktop.
Colorful tag (this is a joke)
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
<colorful>YOU HAVE WON CLICK FOR PRIZE</colorful> <BR> | |
<colorful>YOU HAVE WON CLICK FOR PRIZE</colorful> <BR> | |
<colorful>YOU HAVE WON CLICK FOR PRIZE</colorful> <BR> | |
<colorful>YOU HAVE WON CLICK FOR PRIZE</colorful> <BR> | |
<colorful>YOU HAVE WON CLICK FOR PRIZE</colorful> <BR> | |
<colorful>YOU HAVE WON CLICK FOR PRIZE</colorful> <BR> |
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
function randomHex() { | |
var hex = "#", chars = [0,1,2,3,4,5,6,7,8,9,'A','B','C','D','E','F']; | |
for (var i = 0; i < 6; i++) | |
hex += chars[ ~~(Math.random() * (chars.length+1)) ]; | |
return hex; | |
} | |
var els = document.getElementsByTagName('colorful'); | |
for (var i = 0; i < els.length; i++) | |
(function color(i){ | |
els[i].style.color = randomHex(); | |
setTimeout(color, 200, i) | |
})(i) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment