Skip to content

Commit 1216af9

Browse files
committed
A small introduction for + remove a semi colon
1 parent c895d3f commit 1216af9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

page/performance/optimize-selectors.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ When you select elements, jQuery will call `querySelectorAll` with your selectio
2929
// A long selection with nonstandard pseudo-classes inside
3030
$( "#global.ready .part .list li a:contains('qwerty'):first" );
3131
32-
// A long standard selection with a filter outside (faster):
32+
// A long standard selection with a filter outside (faster)
3333
$( "#global.ready .part .list li a").filter( ":contains('qwerty'):first" );
3434
```
3535

@@ -46,6 +46,8 @@ A "flatter" DOM also helps improve selector performance, as the selector engine
4646

4747
## Save calls to `querySelectorAll`
4848

49+
`querySelectorAll` is already really fast, if you want maintain this speed try to call it the least possible.
50+
4951
```
5052
// If in your HTML there are 2 .container with 5 div in each,
5153
// this line will call querySelectorAll 13 times (1 + 2 + 2*5).

0 commit comments

Comments
 (0)