createAttribute creates a new attribute on the current element.
Syntaxattribute = element.createAttribute(name)
attribute is an attribute node.
name is a string containing the name of the attribute.
The return is a node of type attribute. Once you have this node you can, as in the foregoing example, set its value with the value property. The DOM does not enforce what sort of attributes can be added to a particular element in this manner.