GitHub repository: pohy/caret-pos
Description: Locate the current position of the caret. A plain JavaScript version of Caret.js.