13_页面交互.html 622 B

12345678910111213141516171819202122232425262728
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Document</title>
  7. </head>
  8. <body>
  9. <script>
  10. // 弹框
  11. // alert("hello world");
  12. // 用户输出
  13. // var str = prompt("请输入用户名");
  14. // console.log("欢迎"+str);
  15. // 确认
  16. var str2 = confirm("是否继续!");
  17. console.log(str2);
  18. if(str2){
  19. console.log("你点击了确定");
  20. }else{
  21. console.log("你点击了取消")
  22. }
  23. </script>
  24. </body>
  25. </html>