This page is Almost Ready

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

querySelectorAll

Summary

Returns a list of elements that match a provided selector.

Method of dom/Elementdom/Element

Syntax

var elementList = element.querySelectorAll(/* see parameter list */);

Parameters

selector

Data-type
String

A selector or multiple selectors (separated by commas).

Return Value

Returns an object of type DOM NodeDOM Node

A collection of DOM element nodes. The collection may be empty.

Notes

This method differs from the querySelector method by returning a collection of DOM element nodes that match the selector string, rather than only the first element found. Calling this method with an unknown selector (due to the browser not implementing it, or due to typo and such) may throw an exception.

Related specifications

Selectors API Level 1
Proposed Recommendation

See also

Related articles

Selectors

Related pages

  • DocumentDocument
  • aa
  • address
  • b
  • big
  • blockQuote
  • body
  • button
  • caption
  • center
  • cite
  • code
  • col
  • colGroup
  • dd
  • dfn
  • dir
  • div
  • dl
  • dt
  • em
  • fieldSet
  • form
  • hn
  • html
  • i
  • img
  • input type=button
  • input type=checkbox
  • input type=file
  • input type=image
  • input type=password
  • input type=radio
  • input type=reset
  • input type=submit
  • input type=text
  • isIndex
  • kbd
  • label
  • legend
  • li
  • listing
  • marquee
  • menu
  • noBR
  • ol
  • p
  • plainText
  • pre
  • s
  • samp
  • small
  • span
  • strike
  • strong
  • sub
  • sup
  • tabletable
  • tBody
  • td
  • textArea
  • tFoot
  • th
  • tHead
  • tr
  • tt
  • u
  • ul
  • var
  • xmp
  • Reference
  • querySelectorquerySelector
  • IElementSelector
  • Other Resources
  • W3C Selectors APIW3C Selectors API
  • W3C SelectorsW3C Selectors

Attributions