How to refer to currently selected element in jQuery?
<p>I'm trying to make a script that would insert <code>img</code> element after each link to a certain site with source equal to value of <code>href</code> attribute of given link. This is what I came up with:</p>

<pre><code>$("a[href*=site.com/img/]").after("&lt;img src="+$(this).attr("href")+"&gt;");
</code></pre>

<p>Problem is, <code>$(this)</code> doesn't work (attr() returns <code>undefined</code>). Why is it? How to refer to selected link and its argument <code>href</code>?</p>
