When I try to do .focus(), I expect to set focus on the input element and see the cursor after the last character of the value. And I see it in IE.
In safari / chrome, input gets focus and all text is selected. In firefox / opera, the input gets focus, but the cursor is at the beginning.
What can I do to prevent this and get the right behavior for all browsers?
Example here: http://jsbin.com/ozojol/edit#javascript,html
PS. focus().val('').val(value)the method does not work in IE ... What other workarounds exist?
source
share