js中的确定取消对话窗口

< 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 >

猜你喜欢

转载自blog.csdn.net/MY128/article/details/79773133