Created
February 20, 2014 22:03
-
-
Save petrov82/9124212 to your computer and use it in GitHub Desktop.
undefined error in my prompt
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>User Interaction for JS</title> | |
| </head> | |
| <body> | |
| <p> | |
| <script> | |
| // alert("You're Awesome!"); | |
| // todo: Ask the user for their name. | |
| // Keep asking if an empty input is provided. | |
| confirm('Are you having a good day?'); | |
| do { | |
| var name = prompt('What is your name?'); | |
| } while (prompt() == false); | |
| // todo: Show an alert message that welcomes the user based on their input. | |
| if (prompt() == name) { | |
| alert('Welcome to the site, ' + name); | |
| } else { | |
| confirm('Do you want to continue?') | |
| } | |
| // todo: Ask the user if they like pizza. | |
| // Based on their answer tell show a creative alert message. | |
| </script> | |
| </body> | |
| </html> | |
WritingPanda
commented
Feb 20, 2014
Now, I am not sure if this is working the way I think it is, but it works in the browser. We should walkthrough the logic to make sure everything is sound.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment