![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
html-dom
一个专注写代码的程序媛
本人是个小菜鸟,希望各位有空时可以回答一下我的问题,谢谢!
展开
-
判断一个节点有没有子节点的方法
node.hasChildNodes()node.firstClild !== nullnode.childNodes && node.childNodes.length > 0判断一个节点有没有子节点的方法hasClildNodes方法结合firstChild属性和nextSibling属性,可以遍历当前节点的所有后代节点。function DOMCo...原创 2019-09-11 10:49:54 · 1975 阅读 · 0 评论 -
NodeList转化为数组
var children = document.body.childNodes;var nodeArr = Array.prototype.slice.call(children);原创 2019-09-11 11:02:09 · 606 阅读 · 0 评论 -
button disabled属性样式问题
## 使用选择器:disabled button:disabled { pointer-events: none; cursor: not-allowed; filter: alpha(opacity=65); -webkit-box-shadow: none; box-shadow: none; opacity: ...原创 2019-09-25 17:48:59 · 4596 阅读 · 0 评论