Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript Prompt Popup Box</title> </head> <body> <script> let name = prompt("What's your name?"); if(name.length > 0 && name != "null") { document.write("Hi, " + name); } else { document.write("Anonymous!"); } </script> </body> </html>