Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <head> <script src="loadxmldoc.js"> </script> </head> <body> <script> xmlDoc=loadXMLDoc("books.xml"); x=xmlDoc.getElementsByTagName('book'); for(i=0;i<x.length;i++) { document.write(x.item(i).attributes[0].textContent); document.write("<br>"); } </script> </body> <!-- Mirrored from www.w3schools.com/dom/tryit.asp?filename=try_dom_attr_textcontent by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:22:51 GMT --> </html>
Result:
Try it Yourself - © w3schools.com