Created
March 6, 2017 03:34
-
-
Save venkat/27acd4cc10bb4a4c271cf9e9c5d934c5 to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=27acd4cc10bb4a4c271cf9e9c5d934c5
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> | |
<h2> Enter the secret number </h2> | |
<input id="secret"> | |
<button id="confirm">Confirm</button> | |
<p id="response"></p> | |
</head> | |
<body> | |
</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() { | |
//This line of code below gets the value in the input field and converts it into a number type. You don't have to change this line of code. | |
var input = parseInt($("#secret").val(), 10); | |
//TODO: this code just shows the input value. Instead use the if conditional | |
//to show "Congratulations!" when the input equals your favorite number. | |
$("#response").html(input); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment