Re: Attr nodes in DOM

Dave Halls (daveh@persimmon.co.uk)
Thu, 19 Nov 1998 15:02:49 +0000


Ronald Bourret wrote:

> How do I get all the attributes of an element in DOM?
>
> The third paragraph in the Element interface states that, "...since the
> Element interface inherits from Node, the generic Node interface method
> getAttributes may be used to retrieve the set of all attributes for an
> element." Unfortunately, the description of the Node interface lists no
> such method.
>
> Is this what the attributes property of Node is for?
>
>

from the javadoc (with DOMSDK anyway)...

Interface org.w3c.dom.Node

getAttributes

public NamedNodeMap getAttributes()

A NamedNodeMap containing the attributes of this node (if it is an
Element) or null otherwise.