1 <!DOCTYPE html> 2 <html> 3 4 <head> 5 <meta charset="UTF-8"> 6 <title></title> 7 <script type="text/javascript"> 8 var result = confirm("你确认删除?"); 9 console.log(result); 10 if( result ){ 11 alert("正在删除中..."); 12 }else{ 13 alert("你取消了删除"); 14 } 15 </script> 16 </head> 17 18 <body> 19 </body> 20 21 </html>