Document.GetElementsByTagName

Document.GetElementsByTagName method

This method returns an HTMLCollection of elements with the given tag name.

The complete document is searched, including the root node. The returned HTMLCollection is live, meaning that it updates itself automatically to stay in sync with the DOM tree without having to call this method again.

public HTMLCollection GetElementsByTagName(string tagname)
ParameterTypeDescription
tagnameStringA string representing the name of the elements. The special string “*” represents all elements.

Return Value

A live HTMLCollection of found elements in the order they appear in the tree.

Remarks

Refer to official spec.

See Also