How to get an ID of a specific element that matches a JQuery selector
<p>This should be very simple, but I'm blocking on this....</p>

<p>Let's say, for the sake of argument, that we want to prepend() its ID to each element matching class "class_name".  I thought the right way to do it would be something like:</p>

<p>$('.class_name').prepend($(this).attr('id'));</p>

<p>But it does not work.  It looks like $(this) is only usable inside event callabacks.  But how do I get the ID (or any other attribute) of each specific element?</p>

<p>Many thanks!!!</p>
