- On line 1 in Javascript, write a click handler with the button as the selector
- Add an action in this click handler to show the blue box
- Add a second line of code to your click handler. For example, try changing the CSS of the body or the button
Last active
November 6, 2017 00:44
-
-
Save alexpelan/77610153849c3091f690b923f9ab1c7a to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=77610153849c3091f690b923f9ab1c7a
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>05.4 Multiple jQuery actions in one Click Handler</title> | |
</head> | |
<body> | |
<button id='button1'> Show box </button> | |
<div id='blue'> </div> | |
<div id='red'> </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"]} |
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
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
#blue { | |
height: 200px; | |
width: 200px; | |
background-color: blue; | |
color: white; | |
text-align: center; | |
margin:30px; | |
display: none; | |
} | |
#red{ | |
height:100px; | |
width:100px; | |
background-color:red; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment