Created
March 8, 2017 02:06
-
-
Save venkat/b68da78c17de141948ae44438a007aeb to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=b68da78c17de141948ae44438a007aeb
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>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> |
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"]} |
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
$("#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(); | |
}); |
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
#reset { | |
display: none; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment