JS中confirm,prompt用法

 1 <!DOCTYPE html>
 2 <html lang="en">
 3 <head>
 4     <meta charset="UTF-8">
 5     <title>Document</title>
 6 </head>
 7 <body>
 8     <script type="text/javascript">
 9         window.confirm("小伙子真的不想活了?");
10         // window.prompt("临走前,写点啥吧");
11         document.write('<h3>遗言:</h3>'+prompt("临走前,写点啥吧"));
12     </script>
13 </body>
14 </html>
原文地址:https://www.cnblogs.com/lovebing/p/6738657.html