JQuery Traversing
跟JavaScript DOM類似,JQuery也可以讓我們根據element的相對關係來取得其他element。- parent(), parents([selector]), parentsUnitil(selector): 找到direct parent, all parents, parents between。
- children([selector]), find(selector): 找到direct children, all descendants。
- siblings(), next(), nextAll(), nextUntil(), prev(), prevAll(), prevUntil()
- first(), last()
- eq(): first=eq(0)
- filter(selector)
- not(selector)
>>
- One
- Two
- A
- B
- C
- D
- E
- a
- b
- c
- F
- Three
- Four
- Five