JS提示窗口

1.JS警告框javascript

<html>
<head>
<script type="text/javascript">
function disp_alert()
{
alert("我是警告框!!")
}
</script>
</head>
<body>html

<input type="button" value="顯示警告框" />java

</body>
</html>
 ide

2.JS換行警告框htm

<html>
<head>
<script type="text/javascript">
function disp_alert()
{
alert("再次向您問好!在這裏,咱們向您演示" + '\n' + "如何向警告框添加折行。")
}
</script>
</head>
<body>ip

<input type="button" value="顯示警告框" />input

</body>
</html>
 it

3.JS確認框io

<html>
<head>
<script type="text/javascript">
function disp_alert()
{
alert("再次向您問好!在這裏,咱們向您演示" + '\n' + "如何向警告框添加折行。")
}
</script>
</head>
<body>function

<input type="button" value="顯示警告框" />

</body>
</html>
 

4.JS提示框

<html>
<head>
<script type="text/javascript">
function disp_prompt()
  {
  var name=prompt("請輸入您的名字","Bill Gates")
  if (name!=null && name!="")
    {
    document.write("你好!" + name + " 今天過得怎麼樣?")
    }
  }
</script>
</head>
<body>

<input type="button" value="顯示提示框" />

</body> </html>  

相關文章
相關標籤/搜索