zoukankan      html  css  js  c++  java
  • DOM基本操作 20181223

    DOM基本操作

    • document.createElement()创建元素节点,参数为小写的节点名
    • document.createTextNode()创建文本节点
    • docuemnt.createComment()创建一个注释节点

    • Node.appendChild()添加一个子节点对象,该操作相当于一个剪切的操作
    • parentNode.inserBefore(a, b)parentNodeNodeList中,插入a节点到b节点之前

    • parentNode.removeChild()父节点删除子节点。返回值为删除的childNode
    • childNode.remvoe()自己销毁自身,没有返回值。
    • parentNode.replaceChild()返回值为被替换的Node

    Element的一些属性

    • Element.innerHTML元素内部的HTML内容,可读写
    • Element.innerText元素

    Element上的一些方法

    • Element.setAttribute(Attribute, Value)设置元素的属性和值
    • Element.getAttribute(Attribute)获取元素选定的属性值
  • 相关阅读:
    IfcDirection
    IfcPcurve
    IfcOffsetCurve3D
    IfcOffsetCurve2D
    IfcLine
    IfcEllipse
    IfcCircle
    IfcConic
    IfcTrimmedCurve
    QDockWidget设置为tab切换形式
  • 原文地址:https://www.cnblogs.com/freesfu/p/10167745.html
Copyright © 2011-2022 走看看