谢谢
jQuery('input.autoselect[value]').focus(function() { jQuery(this).select(); });
<input readonly="readonly" type="text" value="You can't edit me!"/>