Limited availability
The selectstart
event of the Selection API is fired when a user starts a new selection.
If the event is canceled, the selection is not changed.
SyntaxUse the event name in methods like addEventListener()
, or set an event handler property.
addEventListener("selectstart", (event) => { })
onselectstart = (event) => { }
Event type
A generic Event
.
// addEventListener version
document.addEventListener("selectstart", () => {
console.log("Selection started");
});
// onselectstart version
document.onselectstart = () => {
console.log("Selection started.");
};
Specifications Browser compatibility See also
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4