Set Attribute
element.setAttribute(name, value)
Set the value of the specified HTML attribute of the DOMElement. Use this method instead of the ‘Custom Attribute’ methods.
Syntax
Parameters
- name : string- The name of the attribute to set
- value : string- The value of the attribute to set
Returns
Promise<null>
A promise that resolves to null