getElementsByClassName() Method
Table of Content:
The getElementsByClassName() method is used for selecting or getting the elements through their class name value. This DOM method returns an array-like object that consists of all the elements having the specified classname . On calling the getElementsByClassName() method on any particular element, it will search the whole document and will return only those elements which match the specified or given class name.
HTML Code:
You can change the below paragraph details. Click below Button
This is paragraph Before click.
JavaScript Code: