Element.getAttribute

Gets an attribute from the html element.

class Element
final
T
getAttribute
(
T
)
(
string name
,
T defaultValue = T.init
)

Parameters

name string

The name of the attribute.

defaultValue T

The default value to return when the attribute wasn't found.

Return Value

Type: T

Returns the attribute's value if found, else the specified default value.

Meta