Last active
August 29, 2015 14:17
-
-
Save amadden80/27042d82d9c3a8bab229 to your computer and use it in GitHub Desktop.
Messing with NYT
This file contains hidden or 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 randomColor() { | |
| red = Math.floor(Math.random()*255); | |
| green = Math.floor(Math.random()*255); | |
| blue = Math.floor(Math.random()*255); | |
| return 'rgb('+red+','+green+','+blue+')'; | |
| } | |
| function messingWithArticles(){ | |
| var articles = document.body.getElementsByTagName('article'); | |
| for (var i=0; i<articles.length; i++){ | |
| articles[i].style.color = randomColor(); | |
| articles[i].style.backgroundColor = randomColor(); | |
| } | |
| } | |
| setInterval(messingWithArticles, 500); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment