DOCTYPE html>
html>
head>
meta charset="utf-8">
title>title>
head>
body>
p>帐号: input type="text" name="" id="" value="" />p>
p>密码: input type="text" name="" id="" value="" />p>
body>
html>
script src="jquery-3.4.1.js" type="text/javascript" charset="utf-8">script>
script type="text/javascript">
// focus() 输入框得到焦点时的处理
// bulr() 输入框失去焦点时的处理
$(function() {
$(‘input:first‘).focus(function() {
$(this).css(‘background‘, ‘#eee‘);
});
$(‘input:first‘).blur(function() {
$(this).css(‘background‘, ‘#fff‘);
});
$(‘input:enabled‘).focus(function() {
$(this).css(‘background‘, ‘#eee‘);
});
$(‘input:enabled‘).blur(function() {
$(this).css(‘background‘, ‘#fff‘);
});
});
script>
参与评论
手机查看
返回顶部