jQuery addBack() Method (original) (raw)
Last Updated : 11 Jul, 2023
The **addBack() is an inbuilt method in jQuery that adds the previous set of elements to the current set. This method adds previous DOM tree elements to the current set and maintains them in the internal stack which will take care of changes to the matched set of elements.
**Syntax:
.addBack(selector)
**Parameters: It accepts an optional parameter "selector".
**Return Value:
- It returns the added element against the specified selector.
**jQuery code to show the working of addBack() method:
**Example 1: In the below code, "p" element is passed as a parameter.
html `