<
button
onclick=
"test()"
>点我吧
</
button
>
<
script
src=
"https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"
>
<
/
script
>
<
script
>
function
test() {
if (
window.
confirm(
'您确定删除此文件吗?')) {
alert(
'你点了确定');
}
else
{
alert(
'你点了取消');
}
}
<
/
script
>