为啥遍历时用了body标签名就整个浏览器页面卡死,用其他标签名就不会,求大神指教
<script type="text/javascript">
var mya=document.getElementsByTagName("body")[0].childNodes;
for(i=0;i<mya.length;i++)
{
document.write(mya[i].nodeType+"<br>");
}
</script>
<script type="text/javascript">
var mya=document.getElementsByTagName("body")[0].childNodes;
for(i=0;i<mya.length;i++)
{
document.write(mya[i].nodeType+"<br>");
}
</script>
2017-07-07
举报