zoukankan      html  css  js  c++  java
  • 《JavaScript DOM编程艺术》附录(dom方法和属性)

    本附录内容:

    (1)创建节点:

          reference = document.createElement(element)

          reference = document.createTextNode(text)

    (2)复制节点:

          reference = node.cloneNode(deep)

    (3)插入节点

          reference = element.appendChild(newChild)

          reference = element.insertBefore(newNode,tagetNode)

    (4)删除节点

           reference = document.removeChild(node)      

    (5)替换节点

          reference = element.replaceChild(newChild,oldChild)

    (6)处理节点

          element.setAttribute(attributeName,attributeValue)

    (7)查找节点

          attributeValue = element.getAttribute(attributeName)

          element = document.getElementById(Id)

          elements = document.getElementsByTagName(tagName)

          booleanValue = element.hasChildNodes

    (8)节点属性

           name = node.nodeName

           value = node.nodeValue

    (9)遍历节点树

          nodeList = node.childNodes

          node.childNodes.length

          reference = node.firstChild

          reference = node.lastChild

          reference = node.nextSibling

          reference = node.parentNode

          reference = node.previousSibling 属性返回一个给定节点的前一个子节点;只读属性     

  • 相关阅读:
    Innodb存储引擎
    Innodb学习之MySQL体系结构
    C# sql查询数据库返回单个值方法
    Welcome To SWPUNC-ACM
    P2184 贪婪大陆 题解
    线上Java调优-Arthas入门
    JVM调优学习笔记
    RabbitMQ博文收藏
    System.Net.WebException: 远程服务器返回错误: (405) 不允许的方法。
    随机过程-Brown运动
  • 原文地址:https://www.cnblogs.com/chinaniit/p/1432786.html
Copyright © 2011-2022 走看看