Example 1 — Official pushStack + remove + end
Push all .box divs, remove them, then pop the stack (CSS-free).
jQuery([])
.pushStack(document.getElementsByTagName("div"))
.filter(".box")
.remove()
.end();
$("#out").text("Boxes removed. Paragraph remains."); How It Works
- Start. An empty jQuery set is the stack base.
- Push. All
divnodes become the active set. - Filter. Keep only
.box, then remove them.

