Skip to content

Instantly share code, notes, and snippets.

@alexpelan
Last active November 6, 2017 00:44
Show Gist options
  • Save alexpelan/77610153849c3091f690b923f9ab1c7a to your computer and use it in GitHub Desktop.
Save alexpelan/77610153849c3091f690b923f9ab1c7a to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=77610153849c3091f690b923f9ab1c7a
<!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>
  1. On line 1 in Javascript, write a click handler with the button as the selector
  2. Add an action in this click handler to show the blue box
  3. Add a second line of code to your click handler. For example, try changing the CSS of the body or the button
{"enabledLibraries":["jquery"]}
#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