焦点

focus() 获取焦点 
blur() 失去焦点

<script src="http://how2j.cn/study/jquery.min.js"></script>

<script>
$(function(){
 $("input").focus(function(){
     $(this).val("获取了焦点");
 });
 
  $("input").blur(function(){
     $(this).val("失去了焦点");
 });

});

</script>  

<style>

</style>

<input type="text" >

<input type="text" >

 

posted @ 2017-09-28 11:49  Rainyn  阅读(132)  评论(0编辑  收藏  举报