Tutorial Support Tabs in Textareas
Normally the tab key moves to the next focusable thing. This inserts a tab character in instead. HTMLTextAreaElement.prototype.getCaretPosit...
https://iskablogs.blogspot.com/2014/03/tutorial-support-tabs-in-textareas.html
Normally the tab key moves to the next focusable thing. This inserts a tab character in instead.
HTMLTextAreaElement.prototype.getCaretPosition = function () { //return the caret position of the textarea
return this.selectionStart;
};
HTMLTextAreaElement.prototype.setCaretPosition = function (position) { //change the caret position of the textarea
this.selectionStart = position;
HTMLTextAreaElement.prototype.getCaretPosition = function () { //return the caret position of the textarea
return this.selectionStart;
};
HTMLTextAreaElement.prototype.setCaretPosition = function (position) { //change the caret position of the textarea
this.selectionStart = position;