但是,当你点击的div中的任何一个,其他的div仍然是蓝色的,点击DIV必须改为红色only.How我们实现使用jQuery的?所有div有背景blue.When我点击任何DIV,背景颜色必须改变为红色只有DIV点击&不是别人
.blue {
background:blue;
width:100px;
height:100px;
display:inline-block;
float:left;
margin-right:20px;
}
<!doctype html>
<html lang="en">
<body>
<div id="test1" class="blue"></div>
<div id="test2" class="blue"></div>
<div id="test3" class="blue"></div>
</body>
</html>
如果你点击任何一个DIV,其变为红色,但再次,如果你在任何其他分区剩余的div单击应该是蓝色而不是红色。所以这没有帮助。 –
@AsmitGhatge检查此琴:https://jsfiddle.net/aligoren/0j8fcbmz/ – Ali
是现在的工作。由于 –