JavaScript Document own method: querySelectorAll()
[this page | pdf | back links]
The querySelectorAll() method (when
applied to the document object of the JavaScript
DOM) returns first
(child) element that matches specified CSSSelector.
It
has the following syntax with the following parameters. It returns a NodeList object representing the first
element that matches the specified CSSSelector or if no such
element exists it does not return any value. If the selector(s) is invalid then
it throws a SYNTAX_ERR exception. The number of such elements can be identified
from the length property of the NodeList object, and individual elements can
then be accessed using relevant index numbers applied to the NodeList object.
document.querySelectorAll(CSSSelectors)
Parameter
|
Required / Optional
|
Description
|
CSSSelectors
|
Required
|
String specifying one
or more CSSSelectors. For multiple selectors, separate each one with a
comma.
|
NAVIGATION LINKS
Contents | Prev | Next | JavaScript DOM (and BOM)