Stackoverflow 2012-03-02b
HTML
<input id="text" type="text" value="EXAMPLE" size="20" />
JavaScript
$('#text').on('click', function() {
var length = $(this).val().length;
this.setSelectionRange(this.selectionStart, length);
});
<input id="text" type="text" value="EXAMPLE" size="20" />
$('#text').on('click', function() {
var length = $(this).val().length;
this.setSelectionRange(this.selectionStart, length);
});