JQuery How to set attribute of element using other attribute of the same element
<p>I want to set title text of a link calling a function which receives as parameter the id of the element and outputs the text.</p>

<p>something like</p>

<pre><code>$(a).attr('title', function() {return $(this).id + "foo"});
</code></pre>

<p>but a construct like this doesn't exist as far I know. What can I do?
Thanks.</p>
