<form id=‘form_test‘>
<input type=‘text‘ />
<input type=‘text‘ />
<input type=‘text‘ />
<input type=‘text‘ />
<input type=‘text‘ />
<input type=‘text‘ />
<input type=‘text‘ />
</form>
<script>
$(document).ready(function(){
    /*文本框获得焦点时,自动选中内容*/
	$("# form_test input[type=‘text‘]").bind(‘focus‘,function(){
	$(this).select();
	})
})
</script>
原文:http://www.cnblogs.com/paulcode/p/6524993.html