Java Reference
In-Depth Information
Methods (continued)
Method Name
Description
Introduced
getElementsByTagName(tagName)
Returns a NodeList of all descen-
dant elements with the specifi ed
tagName in the order in which
they appear in the tree.
Level 1
getElementsByTagNameNS(namespaceURI,
localName)
Returns a NodeList of all the
descendant Element objects
with the specifi ed local name
and namespace URI. Not for
HTML DOMs.
Level 2
hasAttribute(name)
Returns a Boolean value based on
whether or not the element has an
attribute with the specifi ed name.
Level 2
hasAttributeNS(namespaceURI,
localName)
Returns a Boolean value based
on whether the Element has an
attribute with the given local
name and namespace URI. Not
for HTML DOMs.
Level 2
removeAttribute(name)
Removes the attribute with the
specifi ed name.
Level 1
removeAttributeNS(namespaceURI,
localName)
Removes an attribute specifi ed
by the local name and namespace
URI. Not for HTML DOMs.
Level 2
removeAttributeNode(oldAttr)
Removes and returns the speci-
fi ed attribute.
Level 1
setAttribute(name, value)
Creates and adds a new attribute,
or changes the value of an exist-
ing attribute. The value is a simple
string.
Level 1
setAttributeNS(namespaceURI,
qualifiedName, value)
Creates and adds a new attribute
with the specifi ed namespace
URI, qualifi ed name, and value.
Level 2
setAttributeNode(newAttr)
Adds the specifi ed attribute to
the element. Replaces the existing
attribute with the same name if
it exists.
Level 1
setAttributeNodeNS(newAttr)
Adds the specifi ed attribute to the
element.
Level 2
Search WWH ::




Custom Search