Attributes (beta)
Attributes (beta)
These methods let you read and write attributes on elements using array-based access and binding support.
Both attribute names and values can be plain strings or BindingValue references bound to variables or component props.
These methods can write both standard HTML attributes and custom attributes.
To use the methods below, choose an element with a CustomAttributes property of true. Using these methods with elements that don’t have this property will return an error.
To use the methods below, choose an element with a attributes property of true
Using these methods with elements that don’t have this property returns an error.
Beta
These methods are in public beta and may change with future releases.
Methods
Get all attributes as an array of name/value pairs, including binding references.
Get all attributes with bindings resolved to their current values.
Replace all attributes on an element with a provided array of attribute names and values.
Set a single attribute by name or index.
Get the value of a single attribute by name or index.
Get the resolved value of a single attribute by name.
Remove a single attribute by name or index.