<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>显示对话框</title>
</head>
<body>
<script type="text/javascript" language="javascript">
<!--信息对话框-->
function info()
{
alert("基本对话框");
}
<!--确认对话框-->
function choose()
{
if(confirm("请按'确认'或'取消'进行选择"))
{
alert("您按下了'确认'按钮");
}
else
{
alert("您按下了'取消'按钮");
}
}
<!-- 输入对话框 -->
function inputDialog()
{
var msg=prompt("请输入内容","");
if(msg)
{
alert("您输入的内容为:"+msg);
}
}
</script>
<p>基本对话框
<input type="submit" value="提交" οnclick="info()" />
</p>
<p>选择对话框
<input type="submit" value="选择" οnclick="choose()"/>
</p>
<p>输入对话框:
<input type="submit" value="输入" οnclick="inputDialog()"/>
</p>
</body>
</html>
转自:http://www.cnblogs.com/benben7466/archive/2009/12/31/1637011.html