you can do it like this
$.each($("div[id^='comments-wrap']"),function(){ // this will fetch all parent div's
var CurrectDiv=$(this);
CurrectDiv.find('div').filter(function(){
if($(this).attr('class')==CurrectDiv.attr('class'))
{
$(this).hide();
}
});
});