confirm()方法用于显示一个带有指定消息和ok及取消按钮的对话框
用法:if(confirm("确定吗?")){
console.log("确定");
}else{
console.log("取消"); }