Skip to content

Instantly share code, notes, and snippets.

@venkat
Created March 8, 2017 02:06
Show Gist options
  • Save venkat/b68da78c17de141948ae44438a007aeb to your computer and use it in GitHub Desktop.
Save venkat/b68da78c17de141948ae44438a007aeb to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=b68da78c17de141948ae44438a007aeb
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h2> We are volunteers from ______ </h2>
<p> Guess the word </p>
<input id="secret" />
<button id="confirm">Confirm </button>
<button id="reset"> Reset </button>
<p id="answer"></p>
</body>
</html>
{"enabledLibraries":["jquery"]}
$("#confirm").click(function() {
var input = $("#secret").val();
if(input === "secret") {
$("#answer").html("you guessed it");
$("#reset").show();
}
});
$("#reset").click(function() {
$("#secret").val('');
$("#answer").html("");
$("#reset").hide();
});
#reset {
display: none;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment