0
$(function () {
  $(window).load(function () {
    $('#myInput').focus();
  });
})

The above will focus <input type="text" id="myInput" />, but how can I place the cursor at the end of a filled input?

This has been asked before but not solved. selectionStart was mentioned but seems to work for textareas only.

Martin
  • 2,007
  • 6
  • 28
  • 44
  • possible duplicate of [Use JavaScript to place cursor at end of text in text input element](http://stackoverflow.com/questions/511088/use-javascript-to-place-cursor-at-end-of-text-in-text-input-element) – Darin Dimitrov Dec 11 '11 at 17:51

1 Answers1

0

This plugin looks like it might help you.

danludwig
  • 46,965
  • 25
  • 159
  • 237