Skip to content

Instantly share code, notes, and snippets.

@alexpelan
Created November 30, 2016 05:55
Show Gist options
  • Select an option

  • Save alexpelan/4dce0f6a7b9f1762dddc0d354abd9117 to your computer and use it in GitHub Desktop.

Select an option

Save alexpelan/4dce0f6a7b9f1762dddc0d354abd9117 to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=4dce0f6a7b9f1762dddc0d354abd9117
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<p class="knock"> Knock knock.</p>
<p class="whos"> Who's there? </p>
<input id="adjective"> <button class="js-first">Enter your name</button>
<p class="next"> who?</p>
<input id="punchline"> <button class="js-second">Finish the joke!</button>
<p class="punchline"></p>
</body>
</html>
{"enabledLibraries":["jquery"]}
$(".js-first").click(function() {
$(".next").prepend($("#adjective").val());
});
$(".js-second").click(function() {
$(".punchline").append($("#punchline").val());
});
.knock {
color: red;
font-size: 24px;
}
.whos {
color: blue;
font-size: 24px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment