I'm trying to make a script that would insert img element after each link to a certain site with source equal to value of href attribute of given link. This is what I came up with:
$("a[href*=site.com/img/]").after("<img src="+$(this).attr("href")+">");
Problem is, $(this) doesn't work (attr() returns undefined). Why is it? How to refer to selected link and its argument href?