Created
December 9, 2014 00:12
-
-
Save mjchamplin/47d2d87149bac45c993b to your computer and use it in GitHub Desktop.
Five Minute Text Randomizer
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
<html> | |
<head> | |
<title>testing</title> | |
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> | |
<script> | |
// This script randomly populates an item (.quote) with a string from the array "quotes". ie random quote display, etc. | |
$(document).ready(function() { | |
var quotes = new Array("pie", "cookies", "coffee", "Kaytee"), | |
randno = quotes[Math.floor( Math.random() * quotes.length )]; | |
$('.quote').text( randno ); | |
}); | |
</script> | |
<style> | |
.quote { color: red; } | |
</style> | |
</head> | |
<body> | |
<h1>Michael likes <span class="quote"></span></h1> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment