All specs
W3C Selection APIW3CNicheProduct

Selection API

Input & Interaction·World Wide Web Consortium
WHY YOU NEED THIS

Required for rich text editors, annotation tools, and any feature that reads or manipulates text selection. The Selection/Range model is how browsers track cursor position in contenteditable regions.

What It Defines

Defines the Selection and Range interfaces for programmatic text selection. Selection represents the user's highlighted text (window.getSelection()), Range represents a contiguous document fragment. Supports anchor/focus nodes, collapse, extend, and containsNode.

Canonical (Normative)

Convenient (Practical)

selectionrangecursortexteditorbrowser
Standards Body
World Wide Web Consortium

Publishes web platform specs including CSS, accessibility, security policies, Service Workers, Web App Manifest, and many browser APIs. Also maintains some versioned HTML/DOM specs.

Visit

Related Specs

WHATWG DOM LSWHATWGMust Know

DOM

Every frontend framework (React, Vue, Svelte) ultimately produces DOM operations. Understanding the event model and tree structure prevents subtle bugs.

ProductBrowser Platform
Details
W3C Input Events L2W3CShould Know

Input Events

Required for building rich text editors (Notion, Google Docs, ProseMirror, Tiptap). The beforeinput event with inputType lets you intercept and customize every editing operation before it happens.

ProductInput & Interaction
Details