Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery pushStack() method

jQuery pushStack() method

jQuery Miscellaneous MethodsjQuery Miscellaneous Methods

Example

Push some elements onto the jQuery stack, then remove them, and then return to the state just before they were pushed.

<div div>
<script$(function(){$()>

.

pushStack

(

document

.

getElementsByTagName

(

"

div

"

)

)

.

remove

(

)

.

end

(

)

;

}

)

script

Try it >>


Definition and Usage

The pushStack() function is used to add a collection of DOM elements to the jQuery stack.


Syntax

Usage 1

pushStack( elements, name, arguments )

Parameters Description
element Array type: The array elements to be pushed onto the jQuery stack, used to generate a new jQuery object
name Optional. String type: The name of the jQuery method that generates the array elements
arguments Optional. Array type: Arguments passed to the jQuery method (for serialization)

jQuery Miscellaneous MethodsjQuery Miscellaneous Methods