Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. <!DOCTYPE html>
  2.  
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <title>Class 1 Lab</title>
  7. <style>
  8. h1 {
  9. color:rgb(20, 219, 37);
  10. background-color:rgb(37, 19, 139);
  11. }
  12. </style>
  13. </head>
  14. <body>
  15. <header>
  16. <h1>Class 1 Lab</h1>
  17. </header>
  18. <main>
  19. <p style="color:lightseagreen; background-color:saddlebrown">Hello, what's your name?</p>
  20. <p style="color:rgb(35, 166, 206); background-color:rgb(125, 15, 189)">Thank you __userName__. Where are you from?</p>
  21. <p style="color:rgb(155, 18, 47); background-color:rgb(255, 145, 0)">What do you do for a living in __userCity__?</p>
  22. <p style="color:rgb(41, 150, 7); background-color:rgb(46, 21, 156)">Interesting. How many years have you done that?</p>
  23. </main>
  24. <footer>
  25. <p></p>
  26. </footer>
  27. <script>
  28. // get data from user and log to console
  29. var userName = prompt('Hello, what\'s your name?')
  30. console.log('user\'s name: ', userName);
  31. var userCity = prompt('Thank you ' + userName + '. Where are you from?');
  32. console.log('user\'s location: ' + userCity);
  33. var occupation = prompt('What do you do for a living in ' + userCity + '?');
  34. console.log('user\'s occupation: ' + occupation);
  35. var experience = prompt('Interesting. How many years have you done that? ');
  36. console.log('years experience: ' + experience);
  37.  
  38. // farewell to user listing all variables
  39. alert('It was nice meeting you ' + userName + ' from ' +
  40. userCity + ' with ' + experience + ' years experience as a ' + occupation + '.');
  41. </script>
  42. </body>
  43. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement