Tutorial Move Cursor to End of Input
Where el is a reference to an input or textarea. function moveCursorToEnd(el) { if (typeof el.selectionStart == "number") { ...
https://iskablogs.blogspot.com/2014/03/tutorial-move-cursor-to-end-of-input.html
Where el is a reference to an input or textarea.
function moveCursorToEnd(el) {
if (typeof el.selectionStart == "number") {
el.selectionStart = el.selectionEnd = el.value.length;
} else if (typeof el.createTextRange != "undefined") {
el.focus();
var range = el.createTextRange();
range.collapse(false);
range.select();
}
}
function moveCursorToEnd(el) {
if (typeof el.selectionStart == "number") {
el.selectionStart = el.selectionEnd = el.value.length;
} else if (typeof el.createTextRange != "undefined") {
el.focus();
var range = el.createTextRange();
range.collapse(false);
range.select();
}
}