Selection.focusNode

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The Selection.focusNode read-only property returns the Node in which the selection ends.

A user may make a selection from left to right (in document order) or right to left (reverse of document order). The focus is where the user ended the selection. This can be visualized by holding the Shift key and pressing the arrow keys on your keyboard to modify the current selection. The selection's focus moves, but the selection's anchor, the other end of the selection, does not move.

Syntax

node = sel.focusNode

Specifications

Specification Status Comment
Selection API
The definition of 'Selection.focusNode' in that specification.
Working Draft Current

Browser compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
focusNode
Experimental
Chrome Full support YesEdge Full support 12Firefox Full support 3.6IE Full support 10Opera Full support YesSafari Full support 5.1WebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes

Legend

Full support
Full support
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.

See also