Get the value of an element's attribute.

Please note that this command operates on a protocol level and accepts the Web Element ID as the parameter. To retrieve it, use either the .element() or .elements() command. Read more on Element retrieval.

Usage

Parameters

Name Type description
webElementId string

ID of the element to route the command to.

attributeName string

The attribute name

callback function

Callback function which is called with the result value.

W3C WebDriver spec