I'm new to using the XMLDOM parser. I can see if an element has child nodes by using the "hasChildNodes" method. Is there a similar easy way to determine whether an element has attributes?
A node object prototype supports hasAttributes() method which returns boolean as haschildNodes(). Furthermore an element object as a node supports more precise hasAttribute(name) as well.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.