Created
March 30, 2013 22:24
-
-
Save ohrite/5278617 to your computer and use it in GitHub Desktop.
Hey Kids, try this at home!
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
// Your Javascript will go here! | |
function randomValue() { | |
return 127 + Math.floor(Math.random() * 128); | |
} | |
$(document).ready(function() { | |
/* Add code from the next steps here. */ | |
$(document).keydown(function(event) { | |
var color = [randomValue(), randomValue(), randomValue()]; | |
$('body').css('background-color', 'rgb(' + color.join(',') + ')'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment