IElement.GetAttribute(String) Method

Definition

Retrieves an attribute value by name.

[Android.Runtime.Register("getAttribute", "(Ljava/lang/String;)Ljava/lang/String;", "GetGetAttribute_Ljava_lang_String_Handler:Org.W3c.Dom.IElementInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public string? GetAttribute (string? name);
[<Android.Runtime.Register("getAttribute", "(Ljava/lang/String;)Ljava/lang/String;", "GetGetAttribute_Ljava_lang_String_Handler:Org.W3c.Dom.IElementInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member GetAttribute : string -> string

Parameters

name
String

The name of the attribute to retrieve.

Returns

The Attr value as a string, or the empty string if that attribute does not have a specified or default value.

Attributes

Remarks

Retrieves an attribute value by name.

Java documentation for org.w3c.dom.Element.getAttribute(java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to