Selection: anchorOffset 属性
Selection.anchorOffset 只读属性返回当选区的锚点位于 Text、CDATASection 或 Comment 类型的 Selection.anchorNode 中时,锚点在该节点内的字符偏移量。
当 Selection.anchorNode 是其他类型的节点时,Selection.anchorOffset 返回锚点在该 Selection.anchorNode 中的 Node.childNodes 偏移量。
这个数字是从零开始计数的。如果选区从 Selection.anchorNode 的第一个字符开始,则返回 0。