Gets the value of the specified attribute for this element.
Namespace: OpenQA.SeleniumAssembly: WebDriver (in WebDriver.dll) Version: 2.35.0.0 (2.35.0.0)
Syntax
Parameters
- attributeName
- Type:
System String
The name of the attribute.
Return Value
The attribute's current value. Returns a if the value is not set.Exceptions
Exception | Condition |
---|---|
OpenQA.Selenium StaleElementReferenceException | Thrown when the target element is no longer valid in the document DOM. |
Remarks
Attribute name | Value returned if not explicitly specified | Valid element types |
---|---|---|
checked | checked | Check Box |
selected | selected | Options in Select elements |
disabled | disabled | Input and other UI elements |
See Also