JS实现文本框自动选中内容

<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>

posted on 2017-03-09 11:59  潇潇@暮雨  阅读(12669)  评论(0编辑  收藏  举报

导航