Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Guessing game</title>
- </head>
- <body>
- <h1>Welcome to Code 201!</h1>
- </body>
- <script>
- var user = prompt('what is your name?');
- console.log(user);
- alert('hi there ' + user + ', I\'m going to ask you a question');
- var answer = prompt(user + ', this is a yes/no question. please answer with Y or N. do you love coding?');
- console.log('users answer:' + answer);
- if (answer === 'Y') {
- alert('great! coding is awesome!');
- } else {
- alert('that sucks, i wish you like code');
- }
- var loc = prompt('Hey ' + user + ', where are you from if you dont mind telling me?');
- console.log('users location:' + loc);
- alert(user + ' thats great!, I love ' + loc + '!, its amazing there!');
- var whyLearn = prompt('so why are you wanting to learn coding?');
- console.log('why learning' + whyLearn);
- alert('Ok ' + user + ' from ' + loc + ', lets learn some code so you can ' + whyLearn);
- </script>
- </html>
Add Comment
Please, Sign In to add comment