分析下面代码,关于该段代码说法正确的是( &...
发布于 2022-03-03 17:36:43
分析下面代码,关于该段代码说法正确的是( )
<html> <body> <div id="ele" class="div"> <span id="s1" class="sp" lang="zh-cn"> </span> </div> </body> <script type="text/javascript"> function exct() { var oEle = document.getElementById("ele") var child = oEle.children console.log("ele.children的执行结果是:") for(i = 0 i < child.length i++){ console.log(child[i].tagName) } child = oEle.childNodes console.log("ele.childNodes的执行结果是:") for(i = 0 i < child.length i++){ console.log(child[i].tagName) } } exct () </script> </html>
登录后免费查看答案
关注者
0
被浏览
21