confirm(string)
<!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> confirm 函数 </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" language="javascript">
<!--
function mkchoice() {
if (confirm("确定离开曲径通幽?")) {
alert("再见");
}
else {
alert("欢迎你多待些时间。")
}
}
-->
</script>
</head>
<body>
<form name="myForm">
<input type="button" onclick="mkchoice()" value="离开">
</form>
</body>
</html>
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |