Q:

Remove a tag from inside a function called by .each

Inside a function valled by .each I want to remove the a tag(s)/.
Here is a non-working example:
$('div.link').has('div.entry:has(p.title:has(a[href^="http://i.imgur.com/"]))').each(function (i) {
    $(this).css('border', '5px solid');
    $(this).remove('a'); // Does NOT work! Nothing happens...
    console.log($(this));
})

Click image below for full size. The marked line is pure coincidence and indicates nothing. To test stuff out, visit http://reddit.com and use Firebug (jQuery is loaded):

A:

You need to find it, and then remove it:
$(this).find('a').remove();

A:

Provide this as the context:
$("a", this).remove();

The second parameter to the $ function is often times the context for your selector, meaning the area in which you'd like to find matches to your selector. In this particular case, we're saying we'd like to find a elements within this.
jQuery will internally convert this to a find call:
$(this).find("a").remove();

So if you don't mind a slightly more verbose solution (a few chars, no big deal), you can pick up a very negligible performance boost by cutting out the middle-man syntax and using .find directly.

