Tryit Editor v1.8

Source 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].specified); document.write("<br>"); } </script> <p>The specified property returns true if the attribute value is set in the document, and false if it's a default value in a DTD/Schema.</p> </body> </html>
Result:
W3Schools.com - Try it yourself