jQuery addBack() methodThe addBack() method is used to add the previous set of elements to the current set. It is optionally filtered by the selector. It is an inbuilt method in jQuery. SyntaxThe 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. ExampleIn 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 NowOutput After clicking the given button, the output will be - Next TopicjQuery dequeue() method |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India