Javascript Reference
Categories: selection

javascript selection anchorOffset, focusOffset

@March 15, 2008, 1:22 a.m.
anchorOffset, focusOffsetFirefox/Netscape/NN 6 IE n/a Chrome/Safari/DOM n/a  

Read-only  

Return an integer count of characters or nodes from the beginning of the anchor or focus nodes of the selection (see anchorNode and focusNode properties). If the node is a text node, the offset unit is the character; if the node is an element node, the offset unit is the node. This behavior is similar to the offset properties of a Range object. Most typically, these values count characters within text node types. If the selection is set or extended via the addRange( ) method, these properties point to the node boundary offsets of the most recently added range.

 
Example
 
var selStartOffset = selectionRef.anchorOffset;
 
Value

Integer.

 
Default

0


Powered by Linode.