博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
遍历DOM打平
阅读量:7053 次
发布时间:2019-06-28

本文共 677 字,大约阅读时间需要 2 分钟。

html 模板

1

2

a

b

x

y

asd

js

let l = console.log        let box = document.querySelector('.box')        let toArray = Array.from;        scan(box)        function scan(box) {            let arr = toArray(box.children)            for (let ele of arr) {                if (ele.children.length) {                   scan(ele)                }else{                    l( ele)                }            }        }

转载于:https://www.cnblogs.com/ajanuw/p/9218631.html

你可能感兴趣的文章
关于获取客户端Mac地址
查看>>
紫书 例题 10-9 UVa 1636 (概率计算)
查看>>
51nod 01背包
查看>>
outlook anywhere 配置
查看>>
冲刺一 (day 3)
查看>>
Beep使用
查看>>
关于php网络爬虫phpspider。
查看>>
OpenGL的glRotatef旋转变换函数详解
查看>>
c#中 ==与equals有什么区别
查看>>
Oracle Group By ROLLUP-SubTotal
查看>>
PHP 正则表达式
查看>>
Computer Graphics Research Software
查看>>
nodejs进阶(2)—函数模块调用
查看>>
java面向对象高级分层实例_BaseDao
查看>>
iOS 从相册中拿到 图片名 ,截取后缀,图片名
查看>>
linux+nginx+tomcat负载均衡,实现session同步
查看>>
初始JavaScript Promises之二
查看>>
IntelliJ IDEA常见问题解决办法汇总
查看>>
[LeetCode] Container With Most Water 装最多水的容器
查看>>
poj 3624 Charm Bracelet 背包DP
查看>>