<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script src="JQuery/jquery-3.4.1.min.js">
</script>
<script>
$(document).ready(function(){
$("div").on("click","button",function(event){
$(event.delegateTarget).css("background-color", "pink");
});
});
</script>
</head>
<body>
<div style="background-color:red;width: 500px;height: 100px;">
<button>点击</button>
</div>
<br>
<div style="background-color:red;width: 500px;height: 100px;">
<button>点击</button>
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src=
jquery题目
最新推荐文章于 2024-06-27 10:30:00 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)