编辑下面的代码:【加编码】
<html> <head> <script src="/demo/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>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂