confirm() 方法用于显示一个带有指定消息和 OK 及取消按钮的对话框。系统自带提示

W3C地址:::::::   http://www.w3school.com.cn/jsref/met_win_confirm.asp

http://www.w3school.com.cn/tiy/t.asp?f=hdom_confirm

<html>
<head>
<script type="text/javascript">
function show_confirm()
{
var r=confirm("Press a button!");
if (r==true)
  {
  alert("You pressed OK!");
  }
else
  {
  alert("You pressed Cancel!");
  }
}
</script>
</head>
<body>

<input type="button" onclick="show_confirm()" value="Show a confirm box" />

</body>
</html>
原文地址:https://www.cnblogs.com/pengchengzhong/p/6495354.html