DOM 文档对象模型

DOM是啥?

Document Object Model 文档对象模型html

维基百科
https://en.wikipedia.org/wiki/Document_Object_Modelnode

The Document Object Model (DOM) is a cross-platform and language-independent application programming interface that treats an HTML, XHTML, or XML document as a tree structure wherein each node is an object representing a part of the document. The objects can be manipulated programmatically and any visible changes occurring as a result may then be reflected in the display of the document.jquery

文档对象模型是一个跨平台和语言无关的应用程序接口。它把HTML,XHTML或XML文档表示成一种树形结构,其中,每一个节点都是表明文档一个部分的对象。能够以编程的方式操做这些对象而且任何看得见的改变都会直接反应在文档的展现上。编程

分析:api

  1. dom是对象: 既然是对象了,那么就能够经过js来操做;
  2. 树形结构: 树形说明其各个节点间是有父子兄弟这样的关系,那么应该会提供经过一个节点查询相关节点的api
  3. 对dom的修改会直接反馈在ui上: 那么咱们js动态化html页面的过程其实也就是dom的操做过程
  4. 习惯用jquery强大的选择器和dom操做以外,原生的dom接口也要好好熟悉下哇
相关文章
相关标签/搜索