jQuery add() method (original) (raw)

Last Updated : 09 Sep, 2023

The **jQuery add() method is used to add elements to the existing group of elements. This method can add element to the whole document, or just inside the context element if the context parameter is defined.

**Syntax:

$(selector).add(element, context_parameter)

Here selector helps to find the matching element.

**Parameters: It accepts two parameters that are specified below:

**jQuery code to show the working of add() method:

HTML `

Welcome to GfG!!!

Welcome to GeeksforGeeks !!!

Article 1 !!!.
This example adds the same css style for both "p" and "span" elements, using its class and id name!!!

`

**Output: