5_BOM简介.html 947 B

1234567891011121314151617181920212223242526272829303132333435
  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. <div id="box">hello</div>
  10. <script>
  11. // BOM 浏览器对象模型 Browser Object Model 在js中用window来表示
  12. // BOM 所代表就是浏览器 浏览器也为js 预留了一些方法用来操作浏览器
  13. // BOM 要大于 DOM 因为BOM是浏览器的方法 而DOM是浏览器的页面
  14. //
  15. // var box = window.document.getElementById("box");
  16. // console.log(box);
  17. // window这个对象在代码过程中是可以省略的
  18. // 弹框
  19. // alert("hello world");
  20. // window.alert("hello world")
  21. // 确认框
  22. // confirm("你确定要删除吗?");
  23. // 提示框
  24. // prompt("请输入你的姓名");
  25. </script>
  26. </body>
  27. </html>