码迷,mamicode.com
首页 > Web开发 > 详细

JS - Document Object Model

时间:2016-08-20 13:02:07      阅读:149      评论:0      收藏:0      [点我收藏+]

标签:

The DOM specifies:

  • how browsers should create a model of an HTML page.
  • how JavaScript can access and update the contents of a web page while it is in the browser window.

 

DOM is implemented by all major browser makers, covers two primary areas:

  • Making a Model of the HTML page.(DOM tree)
  • Access and changing the HTML page. (API)

 

Example

<html>
<body>
  <div id="page">
    <hl id="header">List</hl>
    <h2>Buy groceries</h2>
    <ul>
      <li id="one" class="hot"><em>fresh</em> figs</li>
      <li id="two" class="hot">pine nuts</li>
      <li id="three" class="hot">honey</li>
      <li id="four">balsamic vinegar</li>
    </ul>
    <script src="js/list.js "></script>
  </div>
</body>
</html>                

  

技术分享

 

 

Working with the DOM tree

技术分享

 

技术分享

 

技术分享

 

JS - Document Object Model

标签:

原文地址:http://www.cnblogs.com/elewei/p/5790052.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!