JSFiddle - React, Tailwind, and code Playground
HTML
<div class="container">
<div class="tabs">
<a href="">Newest</a>
<a href="">Oldest</a>
<a href="">Add</a>
</div>
</div>
<section class="text">
<div id="replace"></div>
</section>
<div id="div1">
<em>Первая</em>
Атамта
</div>
<div id="div2">
Вторая атамта
</div>
<div id="div3">
топ кек
</div>
<div id = "text"></div>
CSS
.tabs a {
border-radius: 5px 5px 0 0;
display: inline-block;
width: 100px;
margin-right: 0em;
text-align: center;
background: #ddd;
padding: 5px;
}
.active {
background-color: #ee1;
}
#div1, #div2, #div3{
display: none;
}
#box{
border:2px solid #000;
width:50%;
min-height:310px;
}
JavaScript
$(document).ready(function(){
$(".tabs a:first-child").click(function(event){
event.preventDefault();
$("#div2, #div3").hide();
$("#div1").fadeIn('fast');
$(this).addClass("active");
});
$(".tabs:nth-child(2) a").click(function(event){
event.preventDefault();
$("#div1, #div3").hide();
$("#div2").fadeIn('fast');
$(this).toggleClass('active')
});
});