commit
60d2e2f2a2
1 changed files with 2 additions and 2 deletions
|
@ -103,7 +103,7 @@ Here we look for all `<li>` elements that are last children:
|
|||
This method is indeed powerful, because any CSS selector can be used.
|
||||
|
||||
```smart header="Can use pseudo-classes as well"
|
||||
Pseudo-classes in the CSS selector like `:hover` and `:active` are also supported. For instance, `document.querySelectorAll(':hover')` will return the collection with elements that the pointer is over now (in nesting order: from the outermost `<html>` to the most nested one).
|
||||
Pseudo-classes in the CSS selector like `:hover` and `:active` are also supported. For instance, `document.querySelectorAll(':hover')` will return the collection with elements that the pointer is over now (in nesting order: from the outermost `<html>` to the most nested one).
|
||||
```
|
||||
|
||||
## querySelector [#querySelector]
|
||||
|
@ -178,7 +178,7 @@ So here we cover them mainly for completeness, while you can still find them in
|
|||
|
||||
- `elem.getElementsByTagName(tag)` looks for elements with the given tag and returns the collection of them. The `tag` parameter can also be a star `"*"` for "any tags".
|
||||
- `elem.getElementsByClassName(className)` returns elements that have the given CSS class.
|
||||
- `document.getElementsByName(name)` returns elements with the given `name` attribute, document-wide. very rarely used.
|
||||
- `document.getElementsByName(name)` returns elements with the given `name` attribute, document-wide. Very rarely used.
|
||||
|
||||
For instance:
|
||||
```js
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue