1-1点击事件
<script > $("#app").click(function(){ $(this).html("change") }) </script>
1-2获取焦点/失去焦点
<script src="libs/jquery-3.6.0.js"></script> <input type="text" id="app"> <script> $("#app").focus(function(){ $(this).css({backgroundColor:"red",width:"100px"}) }) $("#app").focusout(function(){ $(this).css({backgroundColor:"yellow",width:"100px"}) }) </script>
****链式调用**** <input type="text" id="app"> <script> $("#app").focus(function(){ $(this).css({backgroundColor:"red",width:"100px"}) }) .blur.focusout(function(){ $(this).css({backgroundColor:"yellow"}) }) </script>