javascript演示提示对话框confirm

javascript演示提示对话框confirm

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>演示提示对话框</title>
<link rel="stylesheet" type="text/css" href="body.css">
</head>
<body>
	<div align="center">
		<h2>演示提示对话框</h2>
		<a title="您确定要跳转吗?" href="calculator.html" onclick="return testConfirm();">点我跳转</a>
	</div>
</body>

<script type="text/javascript">
	function testConfirm() {
		var result = window.confirm("您确定要跳转吗?");
		//alert("您点击了" + (result == true ? "确定" : "取消"));
		return result;
	}
</script>
</html>

javascript演示提示对话框confirm

javascript演示提示对话框confirm