XML DOM createAttribute() method

Document object reference manual

Definition and usage

Create a new Attr node.

Syntax:

createAttribute(name)
Parameter Description
name The name of the newly created attribute.

throw

If the name parameter contains illegal characters, this method will throw a code of INVALID_CHARACTER_ERR DOMException exception

See

Element.setAttribute() Element.setAttributeNode()

Document object reference manual