Visit Mozilla.org

DOM:Selection:anchorNode

From MDC

« Gecko DOM Reference

[edit] Summary

Returns the node in which the selection begins.

[edit] Syntax

sel.anchorNode

[edit] Notes

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