Skip to content

Instantly share code, notes, and snippets.

@courtney-scripted
Created February 22, 2018 19:33
Show Gist options
  • Save courtney-scripted/1979648fe9787a16e14638442a66e194 to your computer and use it in GitHub Desktop.
Save courtney-scripted/1979648fe9787a16e14638442a66e194 to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=1979648fe9787a16e14638442a66e194
<!DOCTYPE html>
<html>
<head>
<title>jQuery Puns</title>
</head>
<body>
<h1>ScriptEd Pun-A-Thon</h1>
<hr>
<div id="joke-1"> What kind of cheese doesn't belong to you?</div>
<hr>
<div id="joke-2">What does the annoying pepper do?</div>
<hr>
<div id="joke-3">
<p> Why did the bike fall over? </p>
</div>
<hr>
<img id="joke-4" src="https://s16.postimg.org/5fso4wcmd/t_WNHJEV.jpghttps://s16.postimg.org/5mu1wwjx1/ZCIkkze.jpg">
</body>
</html>
{"enabledLibraries":["jquery"],"hiddenUIComponents":["console","editor.css"]}
$("#joke-1").click( function(){
// Task 1: use .html to change the text in joke-1 to "Nacho Cheese"
});
$("#joke-2").click( function(){
// Task 2: use .append to add a paragraph with "It gets jalapeño face!" in it.
});
// Task 3: Create a click handler that appends a paragraph with "It was two-tired" in it.
// Task 4: Create a click handler for joke-4 that changes the attribute src from the current image to this image --> "http://i.imgur.com/ZCIkkze.jpg"
// Bonus: Create a button for each one of these jokes. When the user clicks a button the action should occur
body{
margin-bottom: 100px;
}
div{
font-size: 2em;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment