Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <head> <script src="loadxmlstring.js"></script> </head> <body> <script> text="<book>"; text=text+"<title>Everyday Italian</title>"; text=text+"<author>Giada De Laurentiis</author>"; text=text+"<year>2005</year>"; text=text+"</book>"; xmlDoc=loadXMLString(text); // documentElement always represents the root node x=xmlDoc.documentElement.childNodes; for (i=0;i<x.length;i++) { document.write(x[i].nodeName); document.write(": "); document.write(x[i].childNodes[0].nodeValue); document.write("<br>"); } </script> </body> <!-- Mirrored from www.w3schools.com/dom/tryit.asp?filename=try_dom_parsertest3 by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 07:26:36 GMT --> </html>
Result:
Try it Yourself - © w3schools.com