JavaScript getElementsByTagName() Method
JavaScript getElementsByTagName() Method
The getElementsByTagName()
method returns an HTMLCollection of elements with the given tag name.
Note: When called on the document object, the complete document is searched, including the root node.
Example
Syntax
Parameter Values
Value | Type | Explanation |
---|---|---|
tagName | Required | The tagname of the elements you want to get. |
More Examples
In the following example, we find the length of the given tag.
Example
In the following example, we will apply CSS color property to all the paragraph.
Example
In the following example, we will get all the html tags.
Example
Reminder
Hi Developers, we almost covered 97% of JavaScript Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in JavaScript.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.