Set Custom Attribute
element.setCustomAttribute(name, value)
Set an attribute on an element.
Previously, this method set only custom HTML attributes on an element, but now it can set any attributes.
Syntax
Parameters
name: String - The name of the custom attribute.value: String - The value of the custom attribute
The value of the named custom attribute.
Returns
Promise<null>
A promise that resolves to null