1Copyvar name = window.prompt("Enter your name: ");
2alert("Your name is " + name);
1var person = prompt("Please enter your name", "Harry Potter");
2
3if (person != null) {
4 document.getElementById("demo").innerHTML =
5 "Hello " + person + "! How are you today?";
6}