Cursor moves to the beginning of a text field
问题 I have a certain problem with IE8 (and only IE), when I focus an input field which has text in it the cursor moves to the beginning of that field. I'm trying to set the cursor at the end. I've googled around and found the following solution: function setSelectionRange(input, selectionStart, selectionEnd) { input = document.getElementsByTagName("input")[0]; if (input.createTextRange) { var range = input.createTextRange(); range.collapse(true); range.moveEnd('character', selectionEnd); range