3
如何对HTMLCollection进行遍历
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.
如何对HTMLCollection进行遍历 | Lenix Blog
- 这里创建一个html和js文档作为示范。
- 比如我们要获取这两个p标签。
- 可以看出是一个HTMLCollection。
- 但却不是一个数组。
- 先转化为数组。
- 6
现在就可以进行数组方法的运用了。比如遍历。
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK