System.Windows.Forms.HtmlElement.GetAttribute Method

Retrieves the value of the named attribute on the element.

Syntax

public string GetAttribute (string attributeName)

Parameters

attributeName
The name of the attribute. This argument is case-insensitive.

Returns

The value of this attribute on the element, as a string value. If the specified attribute does not exist on this element, returns an empty string.

Remarks

An attribute in HTML is any valid name/value pair for that element. System.Windows.Forms.HtmlElement exposes only those attributes that are common to all elements, leaving out those that only apply to certain types of elements; SRC is a predefined attribute for the IMG tag, for example, but not for the DIV tag. Use HtmlElement.GetAttribute(string) and HtmlElement.SetAttribute(string, string) to manipulate attributes not exposed on the managed Document Object Model (DOM).

HtmlElement.GetAttribute(string) and HtmlElement.SetAttribute(string, string) are case-insensitive.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 2.0.0.0