- 132 -
getAttributeNode(name)
Parameters
:
name
is a string value.
Return value
: Attribute node
Exceptions thrown
: None
Description
: This method returns the Attribute node that is named name. If no such
attribute exists, then null is returned.
Comments
: This method differs from getAttribute(name) by returning
the actual Attribute
node and not just a string. Also, getAttribute(name)
is a shortcut for
getAttributeNode(name).nodeValue.
removeAttributeNode(oldAttr)
Parameters
: oldAttr is an Attribute node.
Return value
: None
Exceptions thrown
: None
Description
: Removes the attribute oldAttr from the element’s attribute list.
Comments
: In Internet Explorer 5, this method returns oldAttr.
setAttributeNode(newAttr)
Parameters
: newAttr is an Attribute node.
Return value
: None
Exceptions thrown
: None
Description
: The node newAttr is added to the attribute list of the Element node.
Comments
: An Attribute node can be created from scratch using the Document node. An
Attribute node that has been removed from another Element
node can be used in this
method. In Internet Explorer 5, this method returns newAttr.
Example
: