<div class='jsPane'>
<div id="1" class="chat"></div>
<div id="2" class="chat"></div>
<div id="3" class="chat"></div>
<div id="4" class="chat"></div>
</div>
<div id="4" class="chat">text1</div>
<div id="4" class="chat">text2</div>
<div id="4" class="chat">text1</div>
var classes = {};
$('.jspane *[id]').each(function(){
if(classes[this.id])
return $(this).remove();
classes[this.id] = true;
});
*[id]
, а .chat[id]
.