例子:
<html>
<head>
<title></title>
<script type="text/javascript">
function confirmDelete(){
if(confirm("Do you want to delete this record?") == false){
alert("false");
return false;
}else{
alert("true");
return true;
}
}
</script>
</head>
<body>
<a href="http://www.baidu.com" onclick="return confirmDelete();">delete</a>
</body>
</html>