Skip to content

Commit 7497a47

Browse files
committed
code needs to use 4 spaces
1 parent d135ce0 commit 7497a47

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

content/jquery-basics/traversing.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,23 @@ There are four methods for finding the parents from a selection: `$.fn.parent`,
1515
<div class="example" markdown="1">
1616
Selecting an element's direct parent
1717

18-
$('#myList').parent();
18+
$('#myList').parent();
1919
</div>
2020
<div class="example" markdown="1">
2121
Selecting all the parents of an element that match a given selector
2222

23-
$('#myList').parents('div.section');
23+
$('#myList').parents('div.section');
2424
</div>
2525
<div class="example" markdown="1">
2626
Selecting all the parents of an element up to, but *not including* the selector
2727

28-
var section = $('div.section');
29-
$('#myList').parentsUntil(section);
28+
var section = $('div.section');
29+
$('#myList').parentsUntil(section);
3030
</div>
3131
<div class="example" markdown="1">
3232
Selecting the closest parent, note that only one parent will be selected.
3333

34-
$('#myList').closest('#navigation');
34+
$('#myList').closest('#navigation');
3535
</div>
3636
### Children
3737

@@ -40,12 +40,12 @@ There are only 2 methods for finding child elements from a selection: `$.fn.chil
4040
<div class="example" markdown="1">
4141
Selecting an element's direct children
4242

43-
$('#myList').children('li');
43+
$('#myList').children('li');
4444
</div>
4545
<div class="example" markdown="1">
4646
Finding all the links within a selection that match the selector
4747

48-
$('#myList').find('a.external');
48+
$('#myList').find('a.external');
4949
</div>
5050

5151
### Sibilings
@@ -55,17 +55,17 @@ The rest of the traversal methods within jQuery all deal with finding sibiling s
5555
<div class="example" markdown="1">
5656
Selecting an element's next sibiling that matches the given selector
5757

58-
$('#myList').next('div.section');
58+
$('#myList').next('div.section');
5959
</div>
6060
<div class="example" markdown="1">
6161
Selecting an element's previous sibiling that matches the given selector
6262

63-
$('#myList').prev('div.section');
63+
$('#myList').prev('div.section');
6464
</div>
6565
<div class="example" markdown="1">
6666
Selecting an element's sibilings in both directions that matches the given selector
6767

68-
$('#myList').sibilings('div.section');
68+
$('#myList').sibilings('div.section');
6969
</div>
7070

7171
You can see all these methods metioned and more at the docs [http://api.jquery.com/category/traversing/tree-traversal/](http://api.jquery.com/category/traversing/tree-traversal/ "Traversal documentation on api.jquery.com")

0 commit comments

Comments
 (0)