补充按钮事件的函数,确认用户是否退出当前页面,确认之后关闭窗口

<html>

<head>

<script type=”text/javascript” >

function closeWin(){

//在此处添加代码

if(
){

window.close();

}

}

</script>

</head>

<body>

<input type=”button” value=”关闭窗口” />

</body>

</html>

第1个回答  2012-12-18
var r=confirm("Press a button!");

if(r==true)
相似回答