close

在javaScript中 , 若我們想讓使用者輸入value到變數中 , 

我們可以使用Prompt box ,

 

var name = prompt("Please enter your name:");

document.write("Hello , " + name);

 

and if you want to initial the variable , we can use:

 

var name = prompt("Please enter your name" , "Holly");

 

ref : http://www.w3schools.com/js/js_popup.asp

arrow
arrow
    全站熱搜

    JerryCheng 發表在 痞客邦 留言(0) 人氣()