1,alert(Text)起提示警告作用,Text为提示的内容

  <body onload="alert('页面载入中!');">

2,confirm(Text)起判断的作用,text为提示判断的内容.返回一个判断的bool值。

  function Sure()
        {
            if(confirm("Are you sure!")==true)
            {
                document.getElementById("Text1").value=" you click sure!";
               
            }
            else
                document.getElementById("Text1").value="you click false!";
        }

  <input id="Button1" type="button" onclick="Sure()" value="Delete" />

3.prompt(para1,para2),起显示提示的对话框,第一个参数为提示的内容,第二个参数不是必须的,起到文本里面的内容。

<script type="text/javascript">
        document.write("你最喜欢的国家是:"+prompt("你最喜欢的国家是:","中国"));
        document.write("你最喜欢的颜色是:"+prompt("你最喜欢的国家是:","红色"));
    </script>