1var proceed = confirm("Are you sure you want to proceed?");
2if (proceed) {
3 //proceed
4} else {
5 //don't proceed
6}
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}