<script src="jquery-3.4.1.min.js"></script>
*{
margin: 0;
padding: 0;
list-style: none;
}
ul{
width: 408px;
height: 100px;
margin: auto;
margin-top: 100px;
text-align: center;
}
ul li{
width: 100px;
height: 100px;
line-height: 100px;
float: left;
border: 1px solid gainsboro;
}
#box div{
width: 400px;
height: 400px;
margin: auto;
background: gainsboro;
display: none;
}
.b{
background: lavender;
}
<ul>
<li class="b">a</li>
<li>b</li>
<li>c</li>
<li>d</li>
</ul>
<div id="box">
<div>1</div>
<div>4</div>
<div>2</div>
<div>3</div>
</div>
$(function(){
$("ul>li").click(function(){
$(this).addClass('b').siblings().removeClass('b');
var n=$(this).index();
$('#box div').eq(n).show().siblings().hide();
})
})