Set attributes (Beta)
element.setAttributes(attrs)
Replace all attributes on an element with the provided array of attribute names and values.
Both the name and value of each entry can be a string or a BindingValue object.
This method replaces the complete set of attributes — it does not perform a partial update. Any attributes not included in the array are removed.
To set a single attribute without replacing the others, use element.setAttribute().
Beta
These methods are in public beta and may change with future releases.
Syntax
Parameters
attrs: Array<AttributeEntry> — The complete list of attributes to set on the element. Any existing attributes not included in this array are removed.
Related types:
Returns
Promise<null>
A Promise that resolves to null.