when to use iteration?

when to use iteration?

$(document).ready(function() {
$('div.chapter a').attr({
rel: 'external',
title: $(this).text();
},
});

This code is wrong, because $(this).text() could not grab the correct content, but I do not know why.
Jquery is implicit iteration, so the attr() method will run for each matched <a>. then why $(this).text() could not get the content of each <a>?