載入中 |
載入中 |
Display a prompt box which ask the user for her/his name, and output a message:
var person = prompt("Please enter your name", "Harry Potter"); if (person != null) { document.getElementById("demo").innerHTML = "Hello " + person + "! How are you today?"; }
Syntaxprompt(text, defaultText)https://www.w3schools.com/jsref/met_win_prompt.asp