Skip to content

Instantly share code, notes, and snippets.

@afonsomatos
Created June 15, 2015 17:44
Show Gist options
  • Save afonsomatos/77e0d6fafc4a628da71a to your computer and use it in GitHub Desktop.
Save afonsomatos/77e0d6fafc4a628da71a to your computer and use it in GitHub Desktop.
Colorful tag (this is a joke)
<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>
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