Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- addBack() - add the current selection to the previous one and merges those selections
- parent() - selects the direct parent of the current selection
- <div id="parent">
- <div id="child">
- </div>
- </div>
- console.log($('#child').parent()); // return the div#parent selection
- console.log($('#child').addBack()); // return the div#child selection - it merges the div#child with the previous selection (which happens to be empty)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement