I have a selector $('.element') is returning prevObject: e.fn.e.init[3]. I looked into the results and the first object there is what I need. 2 questions here. What is prevObject? Also how can I select from the result the first object. Thanks for any help.
To access the first element, simply use [0] or .get(0)
prevObject is the result of the previous jQuery function call if the calls were chained together. It's what allows the .end() call to pop the jQuery chain back to a prior state.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With