第十一天

85 阅读1分钟

DOM

      + DOM是描述咱们稳定的结构的,文档结构是树型结构
        + 在DOM中把标记什么的称之为节点
        + 作用:
          => 用来操作网页的标记的
          => 获取节点
          => 创建节点
          => 删除节点
          => 操作样式
          => ...
        
  • 节点类型

       => 文档节点 document
         => 原始节点 element
         => 属性节点 attribute
         => 注释节点 comment
         => 文件节点 text
    
  • 访问节点

      => firstChild
         => lastChild
         => childNodes
    
  • 节点属性

       => nodeName 返回的标记节点的名称是大写字母
         => nodeType
         => nodeValue
    
  • 属性节点操作

       => getAttribute()
         => setAttribute()
         => removeAttitude()
    

    js选择器

      + document.querySelector()
       + document.querySelectorAll()
       + 支持css选择器写法