javascript selection anchorOffset, focusOffset

anchorOffset, focusOffsetNN 6 IE n/a 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


1739,Nickname,Homepage or email,Comments here,Add comment