jquery end() method
Translation results:
end
英[end] 美[ɛnd]
n.End;<positive>result;termination;last part
vt.& vi.End, terminate
jquery end() methodsyntax
Function: end() method ends the most recent filtering operation in the current chain and restores the set of matching elements to its previous state.
Syntax: .end()
Description: Most jQuery traversal methods will operate on a jQuery object instance and generate A new object that matches a different set of DOM elements. When this happens, the new set of elements should be pushed onto the stack maintained in the object. Each successful filter method call pushes a new element onto the stack. If we need the old set of elements, we can use end() to pop the new set from the stack.
jquery end() methodexample
<!DOCTYPE html> <html> <head> <style>p { margin:10px; padding:10px; }</style> <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script> </head> <body> <p><span>Hello</span>, how are you?</p> <script>$("p").find("span").end().css("border", "2px red solid");</script> </body> </html>
Click the "Run instance" button to view the online instance
Popular Recommendations
- Integration vs End-to-End (E Testing: Understanding Their Differences and When to Use Them
- Solar System - Front End Challenge Submission
- I made my first front-end project
- MATIC, NEAR, SHIB Signal Bullish Momentum as Month-End Approaches
- Uniswap (UNI) Agrees To Pay $175,000 To End CFTC Charges
- Will the AVAX Price Reach $100 Before the End of 2024?