<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>jq之demo</title> <!--线上jq库--> <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script> <script> $(document).ready(function(){ $("input").focus(function () { $(this).css("background-color","blue"); }) /*失去焦点*/ $("input").blur(function () { $(this).css("background-color","yellow"); }) }); </script> </head> <body> name:<input type="text" name="fullname"><br> email:<input type="text" name="email"> </body> </html>
jq之blur
最新推荐文章于 2022-10-18 10:20:06 发布