.pushStack()
Add a collection of DOM elements onto the jQuery stack.
.pushStack(elements)π‘’ jQuery
elements
Array An array of elements to push onto the stack and make into a new jQuery object..pushStack(elements, name, arguments)π‘’ jQuery
elements
Array An array of elements to push onto the stack and make into a new jQuery object.
name
String The name of a jQuery method that generated the array of elements.
arguments
Array The arguments that were passed in to the jQuery method (for serialization).Add some elements onto the jQuery stack, then pop back off again.
HTML
jQuery([]).pushStack(document.getElementsByTagName("div")).remove().end();
DEMO