載入中
載入中
載入錯誤
還在載入中,請稍候...

    Tetsuhiko的筆記

    Window prompt() Method: w3schools.com

    • 2018-05-04 13:28:06
    • 236
    • 程式
    • Tetsuhiko

    Window prompt() Method

    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?";
    }
    Syntax

    prompt(text, defaultText)
    https://www.w3schools.com/jsref/met_win_prompt.asp
    Top