jQuery addClass() Method (original) (raw)
Last Updated : 11 Jul, 2023
The **addClass() method is an inbuilt method in **jQuery that is used to add more properties to each selected element. It can also be used to change the property of the selected element.
This method can be used in two different ways:
**1) By adding a Class name directly: Here, the Class name can be used directly with the element which is going to be selected.
**Syntax:
$(selector).addClass(className);
**Parameters: It accepts the parameter "className" which is the name of the class that is going to be added.
**Return Value: It returns the selected elements with the added new class.
**Example 1: In this example, we are using the above-explained method.
HTML `
addClass demo