jQuery addBack() method
The selector mentioned in the above syntax is the optional parameter of the addBack() method. It specifies a string that contains a selector expression to match the elements against.
Let's understand the working of the addBack() method using an illustration.
In this example we are applying the addBack() method to the paragraph element with id = "p1". Here, we are also using the nextAll() method to select the next paragraph siblings of the paragraph element with id = "p1".Test it Now
After clicking the given button, the output will be -