返回一个 Range
对象。
语法
range = document.createRange();
range
是一个 Range
对象。
例子
var range = document.createRange(); range.setStart(startNode, startOffset); range.setEnd(endNode, endOffset);
注意
一旦一个 Range 对象被建立,在使用他的大多数方法之前需要去设置他的临界点。
返回一个 Range
对象。
range = document.createRange();
range
是一个 Range
对象。
var range = document.createRange(); range.setStart(startNode, startOffset); range.setEnd(endNode, endOffset);
一旦一个 Range 对象被建立,在使用他的大多数方法之前需要去设置他的临界点。
Document
Document.activeElement
Document.alinkColor
Document.anchors
Document.applets
Document.async
Document.bgColor
Document.body
Document.characterSet
ParentNode.childElementCount
ParentNode.children
Document.compatMode
Document.contentType
Document.currentScript
Document.defaultView
Document.designMode
Document.dir
Document.doctype
Document.documentElement
Document.documentURI
Document.documentURIObject
Document.domain
Document.domConfig
Document.embeds
Document.fgColor
ParentNode.firstElementChild
Document.forms
Document.head
Document.height
Document.images
Document.implementation
Document.inputEncoding
ParentNode.lastElementChild
Document.lastModified
Document.lastStyleSheetSet
Document.linkColor
Document.links
Document.location
Document.mozFullScreen
Document.mozFullScreenElement
Document.mozFullScreenEnabled
Document.mozSyntheticDocument
GlobalEventHandlers.onabort
Document.onafterscriptexecute
Document.onbeforescriptexecute
GlobalEventHandlers.onblur
GlobalEventHandlers.onchange
GlobalEventHandlers.onclick
GlobalEventHandlers.onclose
GlobalEventHandlers.oncontextmenu
GlobalEventHandlers.ondblclick
GlobalEventHandlers.onerror
GlobalEventHandlers.onfocus
GlobalEventHandlers.oninput
GlobalEventHandlers.onkeydown
GlobalEventHandlers.onkeypress
GlobalEventHandlers.onkeyup
GlobalEventHandlers.onload
GlobalEventHandlers.onmousedown
GlobalEventHandlers.onmousemove
GlobalEventHandlers.onmouseout
GlobalEventHandlers.onmouseover
GlobalEventHandlers.onmouseup
Document.onoffline
Document.ononline
GlobalEventHandlers.onreset
GlobalEventHandlers.onresize
GlobalEventHandlers.onscroll
GlobalEventHandlers.onselect
GlobalEventHandlers.onsubmit
Document.origin
Document.plugins
Document.pointerLockElement
Document.popupNode
Document.preferredStyleSheetSet
Document.readyState
Document.referrer
Document.scripts
Document.scrollingElement
Document.selectedStyleSheetSet
Document.styleSheets
Document.styleSheetSets
Document.title
Document.tooltipNode
Document.URL
Document.vlinkColor
Document.width
Document.xmlEncoding
Document.xmlVersion
Document.adoptNode()
Document.caretPositionFromPoint()
caretRangeFromPoint
Document.clear()
Document.close()
Document.createAttribute()
Document.createCDATASection()
Document.createComment()
Document.createDocumentFragment()
Document.createElement()
Document.createElementNS()
Document.createEntityReference()
Document.createEvent()
Document.createExpression()
Document.createNodeIterator()
Document.createNSResolver()
Document.createProcessingInstruction()
Document.createRange()
Document.createTextNode()
Document.createTouch()
Document.createTouchList()
Document.createTreeWalker()
Document.elementFromPoint()
Document.enableStyleSheetsForSet()
Document.evaluate()
Document.execCommand()
Document.exitPointerLock()
Document.getBoxObjectFor()
Document.getElementById()
Document.getElementsByClassName()
Document.getElementsByName()
Document.getElementsByTagName()
Document.getElementsByTagNameNS()
Document.getSelection()
Document.hasFocus()
Document.importNode()
Document.loadOverlay()
Document.mozCancelFullScreen()
Document.mozSetImageElement()
Document.open()
Document.queryCommandSupported()
Document.querySelector()
Document.querySelectorAll()
Document.registerElement()
Document.releaseCapture()
Document.write()
Document.writeln()
Attr
ByteString
CDATASection
CharacterData
ChildNode
Comment
CustomEvent
DOMConfiguration
DOMError
DOMErrorHandler
DOMException
DOMImplementation
DOMImplementationList
DOMImplementationRegistry
DOMImplementationSource
DOMLocator
DOMObject
DOMParser
DOMString
DOMTimeStamp
DOMTokenList
DOMUserData
DocumentFragment
DocumentType
Element
ElementTraversal
Entity
EntityReference
Event
EventTarget
HTMLCollection
MutationObserver
Node
NodeFilter
NodeIterator
NodeList
NonDocumentTypeChildNode
ProcessingInstruction
PromiseResolver
Range
Selection
Text
TextDecoder
TextEncoder
TimeRanges
TreeWalker
TypeInfo
USVString
UserDataHandler
XMLDocument