Skip to content

Commit 8c84def

Browse files
committed
Minor changes
1 parent a487511 commit 8c84def

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

content/javascript/concepts/dom-manipulation/terms/queryselectorall/queryselectorall.md

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
---
22
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.'
44
Subjects:
55
- 'Code Foundations'
6-
- 'Developer Tools'
76
- 'Web Development'
87
Tags:
98
- 'Methods'
@@ -14,15 +13,15 @@ CatalogContent:
1413
- 'paths/front-end-engineer-career-path'
1514
---
1615

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).
1817

1918
## Syntax
2019

2120
```pseudo
22-
querySelectorAll(selectors);
21+
document.querySelectorAll(selectors);
2322
```
2423

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:
2625
- Type selectors (`div`, `p`, `span`)
2726
- Class selectors (`.class-name`)
2827
- ID selectors (`#id-name`)
@@ -41,15 +40,15 @@ const matches = document.querySelectorAll('p');
4140

4241
### Example 2
4342

44-
This example returns a list of all `<div>` elements in the document with a class of either `note` or `alert`:
43+
The following example returns a list of all `<div>` elements in the document with a class of either `note` or `alert`:
4544

4645
```js
4746
const matches = document.querySelectorAll('div.note, div.alert');
4847
```
4948

5049
### Example 3
5150

52-
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`:
5352

5453
```js
5554
const container = document.querySelector('#test');

0 commit comments

Comments
 (0)