<script src="http://code.jquery.com/jquery-latest.js"></script>
<div class="ajax_news">1a</div>
<div class="ajax_news">2b</div>
<div class="ajax_news">3c</div>
<script type="text/javascript">
$(document).ready(function(){
$("div.ajax_news").each(function(){
var a=$(this);
a.attr('id',a.text());
});
});
</script>