Skip to content

Instantly share code, notes, and snippets.

@kirsten
Created January 5, 2018 14:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kirsten/91182e9c309e18a89521fa5ced1bdc5b to your computer and use it in GitHub Desktop.
Save kirsten/91182e9c309e18a89521fa5ced1bdc5b to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=91182e9c309e18a89521fa5ced1bdc5b
<!DOCTYPE html>
<html>
<head>
<title>jQuery Arguments with Homer{</title>
</head>
<body>
<h1>Can I have another donut?</h1>
<img src="https://upload.wikimedia.org/wikipedia/en/0/02/Homer_Simpson_2006.png">
<div>
<button>Click to reply</button>
</div>
<p id="my-reply"></p>
<p id="homers-reply"></p>
</body>
</html>
{"enabledLibraries":["jquery"],"hiddenUIComponents":["console"]}
$("button").click(function() {
$("#my-reply").text("Yes");
});
$("button").click(function() {
//Add a reply from Homer. Look for the div with #homers-reply.
$("#homers-reply").text("woo hoo");
});
//User these click handlers to add changes to the CSS
$("button").click(function() {
$( "h1").css("color","Brown");
});
$("button").click(function() {
});
$("button").click(function() {
});
img {
width: 200px;
}
button {
margin-top: 15px;
}
#homer-reply {
padding: 15px;
display: inline;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment