XML DOM hasAttributes () method
Definition and Usage
hasAttributes () method returns true when the node that owns property, otherwise false.
grammar
nodeObject.hasAttributes()
Examples
The following code fragment uses loadXMLDoc () to " the Books.xml " into xmlDoc, and returns the first <book> element has attributes whether:
Examples
xmlDoc=loadXMLDoc("books.xml");
x=xmlDoc.getElementsByTagName('book')[0];
document.write(x.hasAttributes());
x=xmlDoc.getElementsByTagName('book')[0];
document.write(x.hasAttributes());
Output:
true
try it"
Node objects