JavaScript getElementsByClassName() Method
JavaScript getElementsByClassName() Method
The getElementsByClassName()
method returns all elements whose class attribute matches the specified string.
Note: When called on the document object, the complete document is searched, including the root node.
Example
Syntax
Parameter Values
Value | Type | Explanation |
---|---|---|
className | Required | The class name of the elements you want to get. |
More Examples
In the following example, we will apply CSS to the first element with a className point
.
Example
In the following example, we will apply CSS to all elements with a className point
.
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.