Range.endOffset
read-only property returns a number representing where in the
Range.endContainer
the
范围
ends.
若
endContainer
是
节点
类型
文本
,
注释
,或
CDATASection
, then the offset is the number of characters from the start of the
endContainer
to the boundary point of the
范围
. For other
节点
types, the
endOffset
is the number of child nodes between the start of the
endContainer
and the boundary point of the
范围
. This property is read-only. To change the
endOffset
的
范围
, use one of the
Range.setEnd
方法。
endRangeOffset = range.endOffset;
var range = document.createRange(); range.setStart(startNode,startOffset); range.setEnd(endNode,endOffset); endRangeOffset = range.endOffset;
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
endOffset
|
Chrome Yes | Edge 12 | Firefox 4 | IE 9 | Opera 9 | Safari Yes | WebView Android Yes | Chrome Android Yes | Firefox Android 4 | Opera Android Yes | Safari iOS Yes | Samsung Internet Android Yes |
完整支持
范围
cloneContents()
cloneRange()
collapse()
compareBoundaryPoints()
compareNode()
comparePoint()
createContextualFragment()
deleteContents()
detach()
extractContents()
getBoundingClientRect()
getClientRects()
insertNode()
intersectsNode()
isPointInRange()
selectNode()
selectNodeContents()
setEnd()
setEndAfter()
setEndBefore()
setStart()
setStartAfter()
setStartBefore()
surroundContents()
toString()
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