Returns the element or node that contains the start of the selection.
The start of a selection.
- HTML5 A vocabulary and associated APIs for HTML and XHTML, Section 7.6.1
Returns null if not successful. This is not supported by Windows Internet Explorer 8 or earlier versions. AnchorNode returns the value of the startContainer attribute of the first Range object in the list. See focusNode to find the node that contains the end of a selection.
The following example shows the text that you select, and all the text contained in the anchorNode element.