获取元素节点的节点名称和类型/查看元素的节点类型
- <html>
- <head>
- <script type="text/javascript" src="/example/xdom/loadxmldoc.js"></script>
- </head>
- <body>
- <script type="text/javascript">
- xmlDoc=loadXMLDoc("/example/xdom/books.xml");
- document.write(xmlDoc.documentElement.nodeName);
- document.write("<br />");
- document.write(xmlDoc.documentElement.nodeType);
- </script>
- </body>
- </html>