码迷,mamicode.com
首页 > Web开发 > 详细

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

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

标签:function   text   文本   select   选中   orm   input   bin   document   

<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实现文本框自动选中内容

标签:function   text   文本   select   选中   orm   input   bin   document   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!