HtmlDocument.GetElementsByTagName Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets a collection of browser elements.

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

Syntax

'Declaration
<SecuritySafeCriticalAttribute> _
Public Function GetElementsByTagName ( _
    tagName As String _
) As ScriptObjectCollection
[SecuritySafeCriticalAttribute]
public ScriptObjectCollection GetElementsByTagName(
    string tagName
)

Parameters

Return Value

Type: System.Windows.Browser.ScriptObjectCollection
A collection of references to HTML elements that correspond to the requested tag name.

Exceptions

Exception Condition
ArgumentException

tagName is an empty string.

ArgumentNullException

tagName is nulla null reference (Nothing in Visual Basic).

InvalidOperationException

An unexpected error occurred.

Remarks

If no elements that correspond to the requested tag name are found, an empty collection is returned.

Version Information

Silverlight

Supported in: 5, 4, 3

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.