获取属性的值
- <html>
- <head>
- <script type="text/javascript" src="/example/xdom/loadxmldoc.js">
- </script>
- </head>
- <body>
- <script type="text/javascript">
- xmlDoc=loadXMLDoc("/example/xdom/books.xml");
- txt=xmlDoc.getElementsByTagName("title")[0].getAttribute("lang");
- document.write(txt);
- </script>
- </body>
- </html>