Get Attribute
element.getAttribute(name)
Retrieve the value of the named HTML attribute of the DOMElement. Use this method instead of the ‘Custom Attribute’ methods.
Syntax
Parameters
- name :
string
- The name of the attribute
Returns
- Promise<String>: A promise that resolves to the value of the named HTML attribute for the DOMElement.
- Promise<
null
>: If the attribute doesn’t exist, this method will returnnull
.
Example
Designer Ability
Checks for authorization only