Created
February 22, 2018 21:22
-
-
Save courtney-scripted/dad9a7d987b0b3afaeaa69f20f23d954 to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=dad9a7d987b0b3afaeaa69f20f23d954
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>jQuery Jokes</title> | |
</head> | |
<body> | |
<h1>JQuery Joke Machine</h1> | |
<hr> | |
<div id="joke-1"> | |
<p>What kind of cheese doesn't belong to you?</p> | |
<button id="answer1">Answer</button> | |
</div> | |
<hr> | |
<div id="joke-2"> | |
<p>What does the annoying pepper do?</p> | |
<p id="jokeTwo">Gets jalapeño face!</p> | |
<button id="answer2">Answer</button> | |
</div> | |
<hr> | |
<div id="joke-3"> | |
<p> Why did the bike fall over? </p> | |
<button id="answer3">Answer</button> | |
</div> | |
<hr> | |
<div id="joke-4"> | |
<img id="joke4img" src="https://i.imgflip.com/8uhl0.jpg"> | |
</div> | |
</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":["console"]} |
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
$("#joke-1").click(function(){ | |
$("#joke-1").text("Nacho Cheese"); | |
}); | |
$("#joke-2").click(function(){ | |
$("#jokeTwo").css("color", "red"); | |
}); | |
$("#joke-3").click(function(){ | |
$("#joke-3").append("It was two tired"); | |
}); | |
$("#joke4img").hover(function(){ | |
$("#joke4img").attr("src", "http://punpedia.org/wp-content/uploads/2016/09/download-2-3.jpg"); | |
}); | |
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
body{ | |
margin-bottom: 100px; | |
} | |
div{ | |
font-size: 2em; | |
} | |
#jokeTwo{ | |
color:white; | |
} | |
img{ | |
width:300px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment