JQuery.Caret is JQuery plugin, which provide usefull interface to mainpulate caret position in any inputs, textareas or content ediatables elements.
Get position of caret:
var element = $('div[contenteditable]');
// Return current caret position.
element.caret();
Set position of caret:
var element = $('div[contenteditable]');
element.caret(2);
// If negative, it is treated as sourceLength + position
// where sourceLength is the length of the string.
element.caret(-1);
Having trouble with Jquery.Caret? Contact [email protected] and we’ll help you sort it out.