Skip to content

Instantly share code, notes, and snippets.

@venkat
Created March 6, 2017 03:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save venkat/27acd4cc10bb4a4c271cf9e9c5d934c5 to your computer and use it in GitHub Desktop.
Save venkat/27acd4cc10bb4a4c271cf9e9c5d934c5 to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=27acd4cc10bb4a4c271cf9e9c5d934c5
<!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>
{"enabledLibraries":["jquery"]}
$("#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