Three new methods have been added to the DOM traversal arsenal in 1.4, "
nextUntil
", "prevUntil
" and "parentsUntil
".
Each of these methods will traverse the DOM in a certain direction
until the passed selector is satisfied. So, let’s say you have a list of
fruit:- <ul>
- <li>Apple</li>
- <li>Banana</li>
- <li>Grape</li>
- <li>Strawberry</li>
- <li>Pear</li>
- <li>Peach</li>
- </ul>
- jQuery('ul li:contains(Apple)').nextUntil(':contains(Pear)');
No comments:
Post a Comment