Difference between jQuery parent(), parents() and closest() functions

closest() selects the first element that matches the selector, up from the DOM tree. Begins from the current element and travels up.
parent() selects one element up (single level up) the DOM tree.
parents() method is similar to parent() but selects all the matching elements up the DOM tree. Begins from the parent element and travels up.

Comments

Popular posts from this blog

Bootstrap Breakpoints