首页 > Web开发 > 详细

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

时间:2017-03-09 12:58:43      阅读:140      评论:0      收藏:0      [点我收藏+]

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

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

原文:http://www.cnblogs.com/paulcode/p/6524993.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!