感谢您的支持,我会继续努力的!
打开微信扫一扫,即可进行扫码打赏哦
点我查看本站打赏源码!
Powered by RUNCODEX.COM,学的不仅是技术,更是梦想!!!
<script src="https://cdn.staticfile.org/jquery/2.2.4/jquery.min.js"></script>
<div>
<ul class="uls">
<li>1</li>
</ul>
</div>
xxxxxxxxxx
$(".uls li").click(function(){
$(this).addClass("red");
$(this).siblings().removeClass("red");
})
*{
margin:0;
padding:0;
}
ul,li{
list-style:none;
ul{
width:200px;
height:auto;
border:1px solid #ccc;
ul li{
width:100%;
height:40px;
text-align:center;
line-height:40px;
.red{
background:red;