XML DOM removeAttributeNode() Method

The following code fragment loads "books.xml" into xmlDoc and removes the "category" attribute nodes from all <book> elements

Definition and Usage

The removeAttributeNode() method removes a specified attribute node.

If a default value for the attribute is defined in a DTD, a new attribute immediately appears with the default value.

This function returns the removed attribute node.

Syntax

elementNode.removeAttributeNode(node)
Parameter Description
node Required. The node to remove

❮ Element Object