2013年6月7日 星期五

輸出文字



1. document.write("Hello World");

2. 對話盒                                                                                                                                                  alert ( " Hello World " );

3. 對話盒雙向互動                                                                                                                                                           document.write("最喜歡的顏色:");
document.write(prompt("輸入最喜歡的顏色","紅色"));
 //或是
//str=prompt("輸入你最喜歡的顏色","紅色")            // document.write(str);
           

4. 以單一字串為引數,它顯示出一個包含字串和 確定  及 取消 按鍵的對話盒,並在使用者按下  確定  時傳回 true ,按下取消時傳回  false。                                                                             choose=confirm("選擇【確定】或是【取消】"); alert(choose);




    沒有留言:

    張貼留言