HtmlElement::TagName Property

 

Gets the name of the HTML tag.

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

public:
property String^ TagName {
	String^ get();
}

Property Value

Type: System::String^

The name used to create this element using HTML markup.

Many elements in the HTML Document Object Model have attributes, properties, and methods that are unique to those elements; such as the HREF attribute on the A element, or the Submit method on FORM. Use TagName when you have an element of a potentially arbitrary type, and need to perform a type-specific operation.

The following code example finds all of the IMG tags in a document, and uses the TagName property to test whether the IMG is hyperlinked to another page; if it is, the code assigns the URL to the ALT attribute of the IMG tag, so that users can mouse over the image to see where it will take them.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: