org.w3c.dom.Element.setAttribute
method
public setAttribute(name as String, value as String) as Void throws DOMException
Description

Sets or creates an attribute by name.

Parameters
ParameterDescription
nameAttribute qualified name.
valueAttribute value.
Throws
  • DOMException if the attribute cannot be set.
Example
element.setAttribute("id", "42")