Easy Tutorial
❮ Met Node Clonenode Met Table Createthead ❯

HTML DOM getElementsByTagName() Method

Document Object

Example

Returns a collection of objects with the specified tag name:

Definition and Usage

The getElementsByTagName() method returns a collection of objects with the specified tag name.

Note: The parameter value "*" returns all elements in the document.


Browser Support

All major browsers support the getElementsByTagName() method.


Syntax

Parameters

Parameter Type Description
tagname String Required. The tag name of the elements you want to get.

Return Value

Type Description
NodeList Object A collection of elements with the specified tag name

Technical Details

| DOM Version | Core Level 1 Document Object | | --- | --- |


Document Object

❮ Met Node Clonenode Met Table Createthead ❯