select all on focus but allow normal select after
considers tab focus as well as click focus
tested in IE > 8
HTML
<input value='Lorem ipsum dolor sit amet' />
<br />
<input value='consectetur adipiscing elit.' />
<br />
<input type="hidden" value='Fusce at feugiat erat' />
JavaScript
$('input').on('focus', function() {
var $this = $(this)
.one('mouseup.mouseupSelect', function() {
$this.select();
return false;
})
.one('mousedown', function() {
$this.off('mouseup.mouseupSelect');
})
.select();
});