Please refer to the following link: http://jsfiddle.net/wrb2t6z6/
HTML
<div class="review">
<div id="comment1" class="children"></div>
<div id="comment2" class="children"></div>
<div id="comment3" class="children"></div>
<div id="comment4" class="children"></div>
<div id="comment5" class="children"></div>
</div>
CSS
.review{
background-color:black;
width:100%;
height:500px;
}
.children{
position:relative;
top:50%;
width:20px;
height:20px;
margin:auto;
}
JQuery
$(function(){
setInterval(generate, 500);
})
function generate() {
$("[id*='comment']").each(function(){
$(this).css("background-color", "black")
})
var number= Math.floor(Math.random() * 5) + 1
$("#comment"+number).css("background-color", "white")
}