get

abstract operator fun get(name: String): String?

Returns the value of the attribute with the given name, or null if it does not exist.

For example, if the element has an attribute class="my-class", you can retrieve it with:

val classValue = element["class"]

Return

The value of the attribute, or null if it does not exist.

Parameters

name

The name of the attribute to retrieve.