.parentsUntil( [selector ] [, filter ] )Returns: jQuery
Description: Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object.
-
version added: 1.4.parentsUntil( [selector ] [, filter ] )
-
version added: 1.6.parentsUntil( [element ] [, filter ] )
-
elementA DOM node or jQuery object indicating where to stop matching ancestor elements.
-
filterType: SelectorA string containing a selector expression to match elements against.
-
.parentsUntil()
method traverses through the ancestors of these elements until it reaches an element matched by the selector passed in the method's argument. The resulting jQuery object contains all of the ancestors up to but not including the one matched by the .parentsUntil()
selector.
.parents()
method does when no selector is provided.
Example:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
|