这是
实验性技术
检查
浏览器兼容性表格
要小心谨慎在生产中使用这之前。
onselectstart
特性为
GlobalEventHandlers
混合
EventHandler
处理
selectstart
事件。
selectstart
event fires when the user starts to make a new text selection on a webpage.
object.onselectstart = functionRef;
functionRef
is a function name or a
函数表达式
. The function receives a
FocusEvent
object as its sole argument.
document.onselectstart = function() {
console.log('Selection started!');
};
For a full example, see our Key quote generator demo.
| 规范 | 状态 | 注释 |
|---|---|---|
|
选定 API
The definition of 'GlobalEventHandlers.onselectstart' in that specification. |
工作草案 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
onselectstart
|
Chrome Yes | Edge 12 |
Firefox
52
|
IE Yes | Opera ? | Safari 1.3 | WebView Android Yes | Chrome Android Yes |
Firefox Android
52
|
Opera Android ? | Safari iOS Yes | Samsung Internet Android Yes |
完整支持
兼容性未知
实验。期望将来行为有所改变。
用户必须明确启用此特征。
selectstart
event
GlobalEventHandlers.onselectionchange
GlobalEventHandlers
onabort
onanimationcancel
onanimationend
onanimationiteration
onauxclick
onblur
oncancel
oncanplay
oncanplaythrough
onchange
onclick
onclose
oncontextmenu
oncuechange
ondblclick
ondurationchange
onended
onerror
onfocus
onformdata
ongotpointercapture
oninput
oninvalid
onkeydown
onkeypress
onkeyup
onload
onloadeddata
onloadedmetadata
onloadend
onloadstart
onlostpointercapture
onmousedown
onmouseenter
onmouseleave
onmousemove
onmouseout
onmouseover
onmouseup
onpause
onplay
onplaying
onpointercancel
onpointerdown
onpointerenter
onpointerleave
onpointermove
onpointerout
onpointerover
onpointerup
onreset
onresize
onscroll
onselect
onselectionchange
onselectstart
onsubmit
ontouchcancel
ontouchstart
ontransitioncancel
ontransitionend
onwheel
AbortController
AbortSignal
AbstractRange
Attr
ByteString
CDATASection
CSSPrimitiveValue
CSSValue
CSSValueList
CharacterData
ChildNode
注释
CustomEvent
DOMConfiguration
DOMError
DOMErrorHandler
DOMException
DOMImplementation
DOMImplementationList
DOMImplementationRegistry
DOMImplementationSource
DOMLocator
DOMObject
DOMParser
DOMPoint
DOMPointInit
DOMPointReadOnly
DOMRect
DOMString
DOMTimeStamp
DOMTokenList
DOMUserData
Document
DocumentFragment
DocumentType
元素
ElementTraversal
Entity
EntityReference
事件
EventTarget
HTMLCollection
MutationObserver
节点
NodeFilter
NodeIterator
NodeList
NonDocumentTypeChildNode
ProcessingInstruction
PromiseResolver
范围
StaticRange
文本
TextDecoder
TextEncoder
TimeRanges
TreeWalker
TypeInfo
USVString
UserDataHandler
XMLDocument