为什么长度是0,并且document.write(list[0].innerHTML)没有输出?
<html> <head> <script type="text/javascript"> var list=document.getElementsByTagName("li"); document.write(list.length+"<br/>"); document.write(list[0].innerHTML); </script> </head> <body> <ul> <li>苹果</li> <li>香蕉</li> <li>水蜜桃</li> <li>西瓜</li> </ul> </body> </html>