put cursor at end of text input's value
css, javascript, jquery
Solution
This works for me
<input type="text" autofocus value="value text" onfocus="this.value = this.value;"/>
Problem
So, currently I have a text-input-field with a value that is also autofocused. On page load, the value is selected / highlighted. Is there a way I can put the cursor at the end of the value text instead of highlighting it in javascript or CSS? Here is a js fiddle where the autofocused text's value is highlighted: http://jsfiddle.net/TaGL5/ Here is the HTML code: `<input type="text" value="value text" autofocus />`