Home

textselection

Textselection refers to the action of marking a portion of text within a document or user interface. The selected text is typically highlighted to indicate that it can be operated on, such as being copied, cut, pasted, deleted, or reformatted. In many environments, the selection is visually represented by a highlighted region and, when applicable, an insertion caret indicating the start or end of the selection.

Users create selections through a combination of input methods. Common interactions include dragging the mouse over

Internally, a selection is usually described by a start and end position within the text, or by

Challenges and accessibility considerations include handling complex text layouts, such as grapheme clusters and bidirectional scripts,

text,
using
keyboard
shortcuts
such
as
shift
with
arrow
keys,
or
clicking
to
set
a
new
anchor
point
and
then
extending
the
selection.
On
touch
devices,
tapping
and
dragging
selects
text,
while
double-clicking
or
triple-clicking
can
select
a
word
or
a
line,
respectively.
Some
editors
also
support
rectangular
or
column
selections
for
selecting
blocks
of
text
across
multiple
lines.
an
anchor
and
a
caret.
Web
browsers
expose
this
through
the
Selection
and
Range
APIs,
which
track
the
current
user
selection
within
the
document
and
update
as
the
user
interacts
with
contenteditable
regions
or
forms.
Applications
may
abstract
these
concepts
differently,
but
the
core
idea
remains:
a
defined
substring
or
region
that
can
be
manipulated
as
a
unit.
which
can
affect
boundary
accuracy.
Screen
readers
and
other
assistive
technologies
rely
on
clear,
predictable
selection
behavior
to
convey
context
to
users
navigating
with
keyboards
or
touch.