Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. addBack() - add the current selection to the previous one and merges those selections
  2.  
  3. parent() - selects the direct parent of the current selection
  4.  
  5. <div id="parent">
  6. <div id="child">
  7. </div>
  8. </div>
  9.  
  10. console.log($('#child').parent()); // return the div#parent selection
  11.  
  12. 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