$(".home").append($(".home .coco").sort(() => Math.random() - 0.5));
.row{margin-bottom: 30px;}
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript" ></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js" type="text/javascript" ></script>
<div class="home">
<div class="container">
<div class="row">
<div class="col-sm-3">A</div>
<div class="col-sm-3 coco">B</div>
<div class="col-sm-3">C</div>
<div class="col-sm-3">D</div>
</div>
<div class="row">
<div class="col-sm-3 coco">1</div>
<div class="col-sm-3">2</div>
<div class="col-sm-3 coco">3</div>
<div class="col-sm-3">4</div>
</div>
<div class="row>
<div class="col-sm-3">Red</div>
<div class="col-sm-3">Blue</div>
<div class="col-sm-3">Green</div>
<div class="col-sm-3 coco">Black</div>
</div>
</div>
</div>
Randomly rearrange the content of columns with the same class (coco) within their rows. The content is shuffled within the row and the column is removed from its current position.