3

如何对HTMLCollection进行遍历

 2 years ago
source link: https://blog.p2hp.com/archives/9218
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

如何对HTMLCollection进行遍历 | Lenix Blog

  1. 这里创建一个html和js文档作为示范。
    如何对HTMLCollection进行遍历
  2. 比如我们要获取这两个p标签。
    如何对HTMLCollection进行遍历
  3. 可以看出是一个HTMLCollection。
    如何对HTMLCollection进行遍历
  4. 但却不是一个数组。
    如何对HTMLCollection进行遍历
  5. 先转化为数组。
    如何对HTMLCollection进行遍历
  6. 6

    现在就可以进行数组方法的运用了。比如遍历。

    如何对HTMLCollection进行遍历

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK