Home

selector

A selector is a term used in computing to denote a construct that identifies a subset of items within a data structure, such as a document, a database, or a collection. It specifies criteria to filter or locate elements that match those criteria.

In web development, CSS selectors determine which HTML elements receive a given style. Simple selectors target

In the DOM and JavaScript, selector APIs such as document.querySelector and document.querySelectorAll retrieve a single element

Outside the browser, selectors appear in databases for row filtering, in user interfaces for option picking,

Key related concepts include specificity, the effect of order, and performance considerations when selectors are broad

by
element
name,
class,
or
id;
more
complex
ones
combine
criteria
with
descendant,
child,
adjacent,
and
general
sibling
relationships,
and
can
target
attributes,
states
(pseudo-classes)
and
structural
patterns.
or
a
list
based
on
CSS
selectors.
XPath
provides
a
separate
path-based
selector
language
used
with
XML
and
some
HTML
contexts.
and
in
programming
patterns
that
filter
collections
or
stream
data.
or
complex.