Created
March 20, 2017 03:36
-
-
Save alexpelan/661598ec8d8b4b35100d7adfe2947b96 to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=661598ec8d8b4b35100d7adfe2947b96
This file contains hidden or 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> | |
| <p>If the number is greater than 0 and less than 100, append "That's a small number."</p> | |
| <p>If the number is greater than or equal to 100 and less than 1000, append "That's a medium number"</p> | |
| <p>If the number is greater than 1000, append "That's a large number."</p> | |
| <input> | |
| <button>Click!</button> | |
| </body> | |
| </html> |
This file contains hidden or 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 hidden or 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
| $("button").click(function() { | |
| var number = parseInt($("input").val()); | |
| if (number < 100) { | |
| $("body").append("That's a small number"); | |
| } | |
| if (number < 1000) { | |
| $("body").append("That's a medium number"); | |
| } | |
| if (number > 1000) { | |
| $("body").append("That's a large number"); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment