document文档树的结构

获得dom对象

css常见选择器:
image.png

  • getElementById() —->
  • getElementsByTagName() —-> HTMLCollection(html集合)
  • getElementsByClassName() —-> HTMLCollection

遍历dom

更新dom

添加dom

删除dom