#Textarea selection and caret manipulation with Javascript
Works is all browsers that support selectionStart
.
##Example code
var textarea;
textarea.setCaretPosition(9);
var caretPostion = textarea.getCaretPosition();
textarea.setSelection(0,11);
var selectedText
if (textarea.hasSelection()) {
selectedText = textarea.getSelectedText();
}
##Real Use Example