Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- var greeting;
- var name = true;
- var username = prompt("What's your name?");
- while(name){
- if(username != ""){
- //greeting = "Welcome " + username;
- alert("Greeting " + username);
- name = false;
- break;
- }
- else if(username == ""){
- alert("Please enter your name");
- username = prompt("What's your name?");
- }
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement