Advertisement
ZazoTazo

Greeting

Dec 23rd, 2020
1,050
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2.             var greeting;
  3.             var name = true;
  4.             var username = prompt("What's your name?");
  5.            
  6.             while(name){
  7.                 if(username != ""){
  8.                     //greeting = "Welcome " + username;
  9.                     alert("Greeting " + username);
  10.                     name = false;
  11.                     break;
  12.                 }
  13.                 else if(username == ""){
  14.                     alert("Please enter your name");
  15.                     username = prompt("What's your name?");
  16.                 }
  17.             }
  18. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement