JSFiddle - React, Tailwind, and code Playground
HTML
<button id="btn">Remove the second container</button>
<div class="container clearfix" id="c1">
</div>
<div class="container clearfix" id="c2">
</div>
<div class="container clearfix" id="c3">
</div>
CSS
.container {
margin: 20px auto 0;
height: 20px;
width: 100px;
background: red;
}
JavaScript
$(document).ready(function() {
$("#btn").click(function() {
removeSecondContainer();
});
});
function removeSecondContainer() {
var container = $("#c2");
container.slideToggle(500, function() {
container.remove();
});
}