jQuery TraversingLesson 24Free preview
jQuery Siblings
This lesson is part of jQuery · All levels
Summary
The siblings method is used to move sideways, i.e. elements that are one level with selected elements. Available to all brethren, downwards and upwards. This pattern is very commonly used in tab menus and active item lists.
Key points
- Take all the brother elements at the same level
- Next() and nextAll() take the element after it
- Prev() and prevAll() take the previous element
- NextUntil() and prevUntil() limiting search to a certain extent
- Brother selection is often used to normalize the state of active items
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.