Guest User

Untitled

a guest
Oct 17th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Guessing game</title>
  5. </head>
  6. <body>
  7. <h1>Welcome to Code 201!</h1>
  8. </body>
  9. <script>
  10. var user = prompt('what is your name?');
  11. console.log(user);
  12.  
  13. alert('hi there ' + user + ', I\'m going to ask you a question');
  14.  
  15. var answer = prompt(user + ', this is a yes/no question. please answer with Y or N. do you love coding?');
  16.  
  17. console.log('users answer:' + answer);
  18.  
  19. if (answer === 'Y') {
  20. alert('great! coding is awesome!');
  21. } else {
  22. alert('that sucks, i wish you like code');
  23. }
  24.  
  25. var loc = prompt('Hey ' + user + ', where are you from if you dont mind telling me?');
  26.  
  27. console.log('users location:' + loc);
  28.  
  29. alert(user + ' thats great!, I love ' + loc + '!, its amazing there!');
  30.  
  31. var whyLearn = prompt('so why are you wanting to learn coding?');
  32.  
  33. console.log('why learning' + whyLearn);
  34.  
  35. alert('Ok ' + user + ' from ' + loc + ', lets learn some code so you can ' + whyLearn);
  36.  
  37.  
  38. </script>
  39. </html>
Add Comment
Please, Sign In to add comment