zoukankan      html  css  js  c++  java
  • DOM 属性方法用法

    属性节点

    attribute    getAttribute()   setAttribute()     removeAttribute()

    节点类型

    nodeType  元素返回1     属性返回2    文本返回3

    子节点

    children和childNode

    outerHTLML   innerText     innerHTML

    高级选项

    firstChildren     lastChildren     parentNode      previousSibling      nextSibliing

    oFirst=oUI.firstElementChild  ||  oUI.firstChild第一个子节点

    oLast=oUI.lastElementChild  ||  oUI.lastChild最后一个子节点

    兄弟节点(有兼容性)

    nextSibling     nextElementSibling下一个节点

    prieiousSibling    previousElementSibling上一个节点

    box.insertBefore(newNode,existNode)插入新节点,注意无insetAfter方法

    documentFragment(document.createDocumentFragment())  typenode=11

    offsetWidth/offsetHeight//获取元素宽度,如果修改属性值用   element.style.属性名

    offsetLeft/offsetTop//相对于有定位设置的包含父级对应的位置

  • 相关阅读:
    c# 并行运算二
    c# 并行运算
    Task+http请求
    Task多线程
    SSO系统认证
    web系统权限设计
    AutoMapper的使用
    中间件
    express-middleware
    中间件概念
  • 原文地址:https://www.cnblogs.com/xiangW/p/10622347.html
Copyright © 2011-2022 走看看