This method functions identically to the Window.getSelection()
method; it returns a Selection
object representing the text currently selected in the document.
Document.getSelection()
See also
- Document Object Model
Document
- Properties
activeElement
alinkColor
anchors
applets
async
bgColor
body
characterSet
childElementCount
children
compatMode
contentType
currentScript
defaultView
designMode
dir
doctype
documentElement
documentURI
documentURIObject
domain
domConfig
embeds
fgColor
firstElementChild
forms
fullscreen
fullscreenElement
fullscreenEnabled
head
height
hidden
images
implementation
lastElementChild
lastModified
lastStyleSheetSet
linkColor
links
location
mozSyntheticDocument
onabort
onafterscriptexecute
onanimationcancel
onanimationend
onanimationiteration
onauxclick
onbeforescriptexecute
onblur
onchange
onclick
onclose
oncontextmenu
ondblclick
onerror
onfocus
onfullscreenchange
onfullscreenerror
ongotpointercapture
oninput
onkeydown
onkeypress
onkeyup
onload
onloadend
onloadstart
onlostpointercapture
onmousedown
onmousemove
onmouseout
onmouseover
onmouseup
onoffline
ononline
onpointercancel
onpointerdown
onpointerenter
onpointerleave
onpointermove
onpointerout
onpointerover
onpointerup
onreset
onresize
onscroll
onselect
onselectionchange
onselectionchange
onselectstart
onsubmit
ontouchcancel
ontouchmove
ontouchstart
ontransitioncancel
ontransitionend
origin
plugins
pointerLockElement
popupNode
preferredStyleSheetSet
readyState
referrer
scripts
scrollingElement
selectedStyleSheetSet
styleSheets
styleSheetSets
timeline
title
tooltipNode
URL
visibilityState
vlinkColor
width
xmlEncoding
xmlVersion
- Methods
adoptNode()
append()
caretPositionFromPoint()
caretRangeFromPoint()
clear()
close()
createAttribute()
createCDATASection()
createComment()
createDocumentFragment()
createElement()
createElementNS()
createEntityReference()
createEvent()
createExpression()
createNodeIterator()
createNSResolver()
createProcessingInstruction()
createRange()
createTextNode()
createTouch()
createTouchList()
createTreeWalker()
elementFromPoint()
enableStyleSheetsForSet()
evaluate()
execCommand()
exitFullscreen()
exitPointerLock()
getAnimations()
getBoxObjectFor()
getElementById()
getElementsByClassName()
getElementsByName()
getElementsByTagName()
getElementsByTagNameNS()
getSelection()
hasFocus()
importNode()
loadOverlay()
mozSetImageElement()
open()
prepend()
queryCommandEnabled()
queryCommandSupported()
querySelector()
querySelectorAll()
querySelectorAll()
registerElement()
releaseCapture()
write()
writeln()
- Inheritance:
- Related pages for DOM
Attr
ByteString
CDATASection
CSSPrimitiveValue
CSSValue
CSSValueList
CharacterData
ChildNode
Comment
CustomEvent
DOMConfiguration
DOMError
DOMErrorHandler
DOMException
DOMImplementation
DOMImplementationList
DOMImplementationRegistry
DOMImplementationSource
DOMLocator
DOMObject
DOMParser
DOMPoint
DOMRect
DOMString
DOMTimeStamp
DOMTokenList
DOMUserData
DocumentFragment
DocumentType
Element
ElementTraversal
Entity
EntityReference
Event
EventTarget
HTMLCollection
MutationObserver
Node
NodeFilter
NodeIterator
NodeList
NonDocumentTypeChildNode
ProcessingInstruction
PromiseResolver
Range
Text
TextDecoder
TextEncoder
TimeRanges
TreeWalker
TypeInfo
USVString
UserDataHandler
XMLDocument