Created
June 13, 2017 22:28
-
-
Save danapplegate/33ff89b83d9c9db94403dd4ba8d408fa to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=33ff89b83d9c9db94403dd4ba8d408fa
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Madlib Mayhem</title> | |
</head> | |
<body> | |
<h1 id="madlib-title"></h1> | |
<p id="madlib-target"></p> | |
</body> | |
</html> |
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
{"enabledLibraries":["jquery"],"hiddenUIComponents":["editor.html","editor.css"]} |
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
// Declare the following variables and assign appropriate values to them. Make sure your variable names have the same capitalization! | |
// Note: "superlative" means the "most" or "best" of something. For example, the "smelliest" or "prettiest" | |
// - adjective | |
// - animal | |
// - famousPerson | |
// - food | |
// - liquid | |
// - number1 | |
// - number2 | |
// - pluralCurrency | |
// - pluralTypeOfPerson | |
// - schoolName | |
// - sport | |
// - subject | |
// - superlativeAdjective1 | |
// - superlativeAdjective2 | |
// - typeOfVenue | |
var adjective = "smelly"; | |
// Now call the fillMadlib function! | |
function fillMadlib() { | |
$('#madlib-title').html("Introducing <span class='placeholder'>" + schoolName + "</span>: A School Like No Other"); | |
var output = "<span class='placeholder'>" + schoolName + "</span> is one of America's <span class='placeholder'>" + superlativeAdjective2 + "</span> institutions of <span class='placeholder'>" + subject + "</span> learning. The student body is composed of <span class='placeholder'>" + number2 + "</span> <span class='placeholder'>" + pluralTypeOfPerson + "</span>. The <span class='placeholder'>" + superlativeAdjective1 + "</span> students get the best grades. Students can eat lunch in the <span class='placeholder'>" + adjective + "</span> cafeteria, which features boiled <span class='placeholder'>" + food + "</span> and <span class='placeholder'>" + animal + "</span>-meat sandwiches, with all the <span class='placeholder'>" + liquid + "</span> they can drink, for only <span class='placeholder'>" + number1 + "</span> <span class='placeholder'>" + pluralCurrency + "</span>. The principal of the school, <span class='placeholder'>" + famousPerson + "</span>, is raising money to build a new <span class='placeholder'>" + subject + "</span> laboratory and a new <span class='placeholder'>" + sport + "</span> <span class='placeholder'>" + typeOfVenue + "</span>. Any student who goes to this school can consider themselves very <span class='placeholder'>" + adjective + "</span>."; | |
$('#madlib-target').html(output); | |
} |
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
.placeholder { | |
font-weight: bold; | |
color: blue; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment