This site is mobile accessible. Press the "Tap Here" button to use a different font-size.



Smartphone icons created by Freepik - Flaticon

JS Prompt

// detect button click
onclick="myFunction()"

// activate myFunction()
function myFunction() {
  let text;
  let person = prompt("Please enter your name:", "Harry Potter");
  if (person == null || person == "") {
    text = "User cancelled the prompt.";
  } else {
    text = "Hello " + person + "! How are you today?";
  }
  document.getElementById("demo").innerHTML = text;
}