Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. Node
  4. selectstart

Node: selectstart event

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Theselectstart event of theSelection API is fired when a user starts a new selection.

If the event is canceled, the selection is not changed.

Syntax

Use the event name in methods likeaddEventListener(), or set an event handler property.

js
addEventListener("selectstart", (event) => { })onselectstart = (event) => { }

Event type

A genericEvent.

Examples

js
// addEventListener versiondocument.addEventListener("selectstart", () => {  console.log("Selection started");});// onselectstart versiondocument.onselectstart = () => {  console.log("Selection started.");};

Specifications

Specification
Selection API
# selectstart-event
Selection API
# dom-globaleventhandlers-onselectstart

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp