You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: content/javascript/concepts/dom-manipulation/terms/queryselectorall/queryselectorall.md
+6-7
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,8 @@
1
1
---
2
2
Title: '.querySelectorAll()'
3
-
Description: 'Returns a static (non-live) NodeList of all elements in the document that match the specified CSS selectors.'
3
+
Description: 'Returns a static (non-live) NodeList of all elements in the document that match the given CSS selectors.'
4
4
Subjects:
5
5
- 'Code Foundations'
6
-
- 'Developer Tools'
7
6
- 'Web Development'
8
7
Tags:
9
8
- 'Methods'
@@ -14,15 +13,15 @@ CatalogContent:
14
13
- 'paths/front-end-engineer-career-path'
15
14
---
16
15
17
-
The document method**`querySelectorAll()`** returns a static (not live) `NodeList` of all elements that match the specified group of selectors.
16
+
In JavaScript, the**`.querySelectorAll()`**method under the `document` object returns a static (not live) `NodeList` of all elements that match the given group of [selectors](https://www.codecademy.com/resources/docs/css/selectors).
18
17
19
18
## Syntax
20
19
21
20
```pseudo
22
-
querySelectorAll(selectors);
21
+
document.querySelectorAll(selectors);
23
22
```
24
23
25
-
-`selectors`: A string containing one or more CSS selectors used to match elements in the document. It follows the same rules as CSS [selectors](https://www.codecademy.com/resources/docs/css/selectors) and can include:
24
+
-`selectors`: Represents a string containing one or more CSS selectors used to match elements in the document. It follows the same rules as CSS selectors and can include:
In this example, we get a list of `<p>` elements whose immediate parent is a `<div>` with the class `highlighted`, and which are inside a container with the ID `test`:
51
+
In this example, a list of `<p>` elements is obtained, whose immediate parent is a `<div>` with the class `highlighted`, and which are inside a container with the ID `test`:
0 commit comments