12.提示框.html 670 B

12345678910111213141516171819202122
  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. // alert("xxx");//警告框
  11. // confirm("提示内容");//确认框
  12. // window.alert("你好")
  13. // 提示框
  14. // prompt("提示的内容信息",默认内容);
  15. var a = prompt("提示的内容信息",20);
  16. console.log(a)
  17. // 案例1:进入页面 输入月份 页面显示当前月份及月份的天数;
  18. // 案例2:进入页面 输入年份 页面显示当前年月及平年/闰年;
  19. </script>
  20. </body>
  21. </html>