zoukankan      html  css  js  c++  java
  • 节点列表和HTML集合

    getElementsByName()和getElementByTagName()返回的都是NodeList集合。

    而document.images和document0.forms的属性为HTMLCollection对象。

    这些对象都是只读的类数组对象昂,他们都有length属性,可以使用如下标准的循环进行迭代:

    for(var i=0;i<document.images.length;i++)

        document.images[i].style.display = "none";

    不能直接在NodeList和HTML集合上使用Array的方法,但可以间接地使用:

    var snapshot = Array.prototype.slice.call(nodelist,0);

  • 相关阅读:
    Python with
    Python else
    Python list
    The Python Debugger Pdb
    RPM 包
    yum
    OpenStack I18N
    Python unittest
    MySQL 行格式
    MySQL 行溢出数据
  • 原文地址:https://www.cnblogs.com/mingluosunshan/p/3286465.html
Copyright © 2011-2022 走看看