Node: selectstart-Ereignis
Das selectstart
-Ereignis der Selection API wird ausgelöst, wenn ein Benutzer eine neue Auswahl beginnt.
Wenn das Ereignis abgebrochen wird, ändert sich die Auswahl nicht.
Syntax
Verwenden Sie den Ereignisnamen in Methoden wie addEventListener()
oder setzen Sie eine Ereignishandler-Eigenschaft.
js
addEventListener("selectstart", (event) => {});
onselectstart = (event) => {};
Ereignistyp
Ein generisches Event
.
Beispiele
js
// addEventListener version
document.addEventListener("selectstart", () => {
console.log("Selection started");
});
// onselectstart version
document.onselectstart = () => {
console.log("Selection started.");
};
Spezifikationen
Specification |
---|
Selection API # selectstart-event |
Selection API # dom-globaleventhandlers-onselectstart |
Browser-Kompatibilität
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
selectstart event |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.