I\'m after the following functionality:
Just delay it by a millisecond with setTimeout
:
$('input[type="text"]').live('focus', function() {
var inp = this;
setTimeout(function() {
inp.select();
}, 1);
});
http://jsfiddle.net/HmQxZ/14/
What's happening is some other browser event is setting the selection after you've selected the text. So, by waiting a millisecond, you let all the browser events finish, and then select the text. Nothing will undo it now.