留白未来
2016-07-03 11:31
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>节点属性</title> </head> <body> <ul> <li>javascript</li> <li>HTML/CSS</li> <li>jQuery</li> </ul> <script type="text/javascript"> var myL=document.getElementsByTagName("li"); document.write(myL.length+"<br>"); for(var i=0;i<myL.length;i++){ document.write(myL[i].nodeName+"<br>"); document.write(myL[i].nodeValue+"<br>"); document.write(myL[i].nodeType+"<br>"); } </script> </body> </html>
可参考http://zhidao.baidu.com/question/1894073173022217900.html
JavaScript进阶篇
468060 学习 · 21891 问题
相似问题