| jquery Programming Glossary: elemlenJquery focus on first text field and set cursor at value end for instant data entry http://stackoverflow.com/questions/12654324/jquery-focus-on-first-text-field-and-set-cursor-at-value-end-for-instant-data-en  document .ready function var el input text .get 0 var elemLen el.value.length el.selectionStart elemLen el.selectionEnd elemLen.. text .get 0 var elemLen el.value.length el.selectionStart elemLen el.selectionEnd elemLen el.focus https developer.mozilla.org.. el.value.length el.selectionStart elemLen el.selectionEnd elemLen el.focus https developer.mozilla.org en US docs XUL Property.. 
 Set Focus After Last Character in Text Box http://stackoverflow.com/questions/4609405/set-focus-after-last-character-in-text-box  more proper cleaner way function SetCaretAtEnd elem var elemLen elem.value.length For IE Only if document.selection  Set focus.. position to 0 then set at end oSel.moveStart 'character' elemLen oSel.moveStart 'character' elemLen oSel.moveEnd 'character'.. 'character' elemLen oSel.moveStart 'character' elemLen oSel.moveEnd 'character' 0 oSel.select  else if elem.selectionStart.. 
 Jquery focus on first text field and set cursor at value end for instant data entry http://stackoverflow.com/questions/12654324/jquery-focus-on-first-text-field-and-set-cursor-at-value-end-for-instant-data-en   jquery focus   share improve this question   Here's an EXAMPLE document .ready function var el input text .get 0 var elemLen el.value.length el.selectionStart elemLen el.selectionEnd elemLen el.focus https developer.mozilla.org en US docs XUL Property..   Here's an EXAMPLE document .ready function var el input text .get 0 var elemLen el.value.length el.selectionStart elemLen el.selectionEnd elemLen el.focus https developer.mozilla.org en US docs XUL Property selectionStart https developer.mozilla.org.. .ready function var el input text .get 0 var elemLen el.value.length el.selectionStart elemLen el.selectionEnd elemLen el.focus https developer.mozilla.org en US docs XUL Property selectionStart https developer.mozilla.org en US docs XUL Property.. 
 Set Focus After Last Character in Text Box http://stackoverflow.com/questions/4609405/set-focus-after-last-character-in-text-box  #Prefix .val #Prefix .val after you set the focus This is the more proper cleaner way function SetCaretAtEnd elem var elemLen elem.value.length For IE Only if document.selection  Set focus elem.focus  Use IE Ranges var oSel document.selection.createRange..  Use IE Ranges var oSel document.selection.createRange  Reset position to 0 then set at end oSel.moveStart 'character' elemLen oSel.moveStart 'character' elemLen oSel.moveEnd 'character' 0 oSel.select  else if elem.selectionStart elem.selectionStart..  Reset position to 0 then set at end oSel.moveStart 'character' elemLen oSel.moveStart 'character' elemLen oSel.moveEnd 'character' 0 oSel.select  else if elem.selectionStart elem.selectionStart '0'  Firefox Chrome elem.selectionStart.. 
 |