<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>? ? <title></title>? ? <script>? ? ? ? window.onload = function () {? ? ? ? ? ? alert(document.getElementById('div1').getElementsByTagName['ul'][0].getElementsByTagName['li'].length);? ? ? ? }? ? </script></head><body>? ? <div id="div1">? ? ? ? <ul>? ? ? ? ? ? <li>nihao</li>? ? ? ? ? ? <li>js</li>? ? ? ? ? ? <li>hello</li>? ? ? ? ? ? <li>html5</li>? ? ? ? </ul>? ? </div></body></html>js中為什么無法執行?
為什么這段js代碼0總是出錯?把0拿掉之后length又出錯?
weibo_張張張張張大仙呀_03578611
2016-08-14 01:02:55