我所有浏览器显示的子节点个数都是3,节点也是1。是版本原因么?
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> </head> <body> <ul> <li>javascript</li> <li>jQuery</li> <li>PHP</li> </ul> <script> var x=document.getElementsByTagName("li"); document.write("ul子节个数"+x.length); document.write("节点类型"+x[0].nodeType); </script> </body> </html>