zoukankan      html  css  js  c++  java
  • DOM操作:

     1 getElementById        //获取ID元素
    2 getElementsByTagName               // 获取class类元素
    3 childNodes                //子节点 特殊浏览器包括默认的文本节点(换行等……)
    4 children                        //子节点
    5 firstChild/firstElementChildlastChild/lastElementChild//兄弟节点
    6 nextSibling/nextElementSiblingpreviousSibing/previousElementSibing
    7 parentNode      //父节点
    8 offsetParent        //有定位属性的父节点
    9 nodeType                //节点类型
    10 offsetWidth        //元素的宽度(包括padding和border)
    11 offsetHeight        //元素的高度(包括padding和border)
    12 clientWidth        //可视区宽度
    13 clientHeight        //可视区高度
    14 createElement_x                //创建dom节点
    15 a                //插入子节点
    16 insertBefore                //在子节点的第一个前面插入
    17 removeChild                //删除子节点
    18 replaceChild                //替换节点 并返回被替换元素DOM操作:

    BOM操作:

    1 window.open()       
    2 window.close()
    3 window.location
    4 window.location.search 5 window.location.hash
    6 window.navigator.userAgent

  • 相关阅读:
    windows平台下一款强大的免费代理获取工具
    彻底搞懂Git Rebase
    line-height
    text-indent
    text-decoration
    text-align
    color
    CSS属性汇总
    font
    font-style
  • 原文地址:https://www.cnblogs.com/huaobin/p/14162617.html
Copyright © 2011-2022 走看看