{"id":594,"date":"2023-08-25T17:22:48","date_gmt":"2023-08-25T17:22:48","guid":{"rendered":"\/\/api.jquery.com\/?p=594"},"modified":"2024-04-20T18:07:36","modified_gmt":"2024-04-20T18:07:36","slug":"pushStack","status":"publish","type":"post","link":"https:\/\/api.jquery.com\/pushStack\/","title":{"rendered":".pushStack()"},"content":{"rendered":"<article id=\"pushStack1\" class=\"entry method\"><h2 class=\"section-title\">\n<span class=\"name\">.pushStack( elements )<\/span><span class=\"returns\">Returns: <a href=\"http:\/\/api.jquery.com\/Types\/#jQuery\">jQuery<\/a><\/span>\n<\/h2>\n<div class=\"entry-wrapper\">\n<p class=\"desc\"><strong>Description: <\/strong>Add a collection of DOM elements onto the jQuery stack.<\/p>\n<ul class=\"signatures\">\n<li class=\"signature\">\n<h4 class=\"name\">\n<span class=\"version-details\">version added: <a href=\"\/category\/version\/1.0\/\">1.0<\/a><\/span><a id=\"pushStack-elements\" href=\"#pushStack-elements\"><span class=\"icon-link\"><\/span>.pushStack( elements )<\/a>\n<\/h4>\n<ul><li id=\"pushStack-elements-elements\">\n<div><strong>elements<\/strong><\/div>\n<div>Type: <a href=\"http:\/\/api.jquery.com\/Types\/#Array\">Array<\/a>\n<\/div>\n<div>An array of elements to push onto the stack and make into a new jQuery object.<\/div>\n<\/li><\/ul>\n<\/li>\n<li class=\"signature\">\n<h4 class=\"name\">\n<span class=\"version-details\">version added: <a href=\"\/category\/version\/1.3\/\">1.3<\/a><\/span><a id=\"pushStack-elements-name-arguments\" href=\"#pushStack-elements-name-arguments\"><span class=\"icon-link\"><\/span>.pushStack( elements, name, arguments )<\/a>\n<\/h4>\n<ul>\n<li id=\"pushStack-elements-name-arguments-elements\">\n<div><strong>elements<\/strong><\/div>\n<div>Type: <a href=\"http:\/\/api.jquery.com\/Types\/#Array\">Array<\/a>\n<\/div>\n<div>An array of elements to push onto the stack and make into a new jQuery object.<\/div>\n<\/li>\n<li id=\"pushStack-elements-name-arguments-name\">\n<div><strong>name<\/strong><\/div>\n<div>Type: <a href=\"http:\/\/api.jquery.com\/Types\/#String\">String<\/a>\n<\/div>\n<div>The name of a jQuery method that generated the array of elements.<\/div>\n<\/li>\n<li id=\"pushStack-elements-name-arguments-arguments\">\n<div><strong>arguments<\/strong><\/div>\n<div>Type: <a href=\"http:\/\/api.jquery.com\/Types\/#Array\">Array<\/a>\n<\/div>\n<div>The arguments that were passed in to the jQuery method (for serialization).<\/div>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<section class=\"entry-examples\" id=\"entry-examples\"><header><h2>Example:<\/h2><\/header><div class=\"entry-example\" id=\"example-0\">\n<p>Add some elements onto the jQuery stack, then pop back off again.<\/p>\n<div class=\"syntaxhighlighter javascript\">\n\t<table>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t\n\t\t\t\t<td class=\"gutter\">\n\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"line n1\">1<\/div>\n\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"line n2\">2<\/div>\n\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"line n3\">3<\/div>\n\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"line n4\">4<\/div>\n\t\t\t\t\t\n\t\t\t\t<\/td>\n\t\t\t\t\n\t\t\t\t<td class=\"code\">\n\t\t\t\t\t<pre><div class=\"container\"><div class=\"line\"><code>jQuery([])<\/code><\/div><\/div><div class=\"container\"><div class=\"line\"><code>  .pushStack( <span class=\"hljs-built_in\">document<\/span>.getElementsByTagName( <span class=\"hljs-string\">\"div\"<\/span> ) )<\/code><\/div><\/div><div class=\"container\"><div class=\"line\"><code>  .remove()<\/code><\/div><\/div><div class=\"container\"><div class=\"line\"><code>  .end();<\/code><\/div><\/div><\/pre>\n\t\t\t\t<\/td>\n\t\t\t<\/tr>\n\t\t<\/tbody>\n\t<\/table>\n<\/div>\n\n<\/div><\/section>\n<\/div><\/article>","protected":false},"excerpt":{"rendered":"<p>Add a collection of DOM elements onto the jQuery stack.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[40,78,87],"tags":[],"class_list":["post-594","post","type-post","status-publish","format-standard","hentry","category-internals","category-78","category-87"],"_links":{"self":[{"href":"https:\/\/api.jquery.com\/wp-json\/wp\/v2\/posts\/594","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/api.jquery.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/api.jquery.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/api.jquery.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/api.jquery.com\/wp-json\/wp\/v2\/comments?post=594"}],"version-history":[{"count":2,"href":"https:\/\/api.jquery.com\/wp-json\/wp\/v2\/posts\/594\/revisions"}],"predecessor-version":[{"id":997,"href":"https:\/\/api.jquery.com\/wp-json\/wp\/v2\/posts\/594\/revisions\/997"}],"wp:attachment":[{"href":"https:\/\/api.jquery.com\/wp-json\/wp\/v2\/media?parent=594"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/api.jquery.com\/wp-json\/wp\/v2\/categories?post=594"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/api.jquery.com\/wp-json\/wp\/v2\/tags?post=594"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}