Created
January 5, 2018 14:44
-
-
Save kirsten/91182e9c309e18a89521fa5ced1bdc5b to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=91182e9c309e18a89521fa5ced1bdc5b
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
<!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> |
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
{"enabledLibraries":["jquery"],"hiddenUIComponents":["console"]} |
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
$("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() { | |
}); |
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
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