Spostare il cursore alla fine dell'input - Trucchi CSS

Anonim

Dove elè un riferimento a un input oa un'area di testo.

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(); ) )