any86 / Notes

:rocket: 笔记
https://github.com/any86/Notes/issues
28 stars 9 forks source link

判断DOM元素是否有子元素的3种方法 #50

Open any86 opened 3 years ago

any86 commented 3 years ago
node.firstChild !== null
node.childNodes.length > 0
node.hasChildNodes()