views:

539

answers:

1

I have this code;

$(this).children("a:eq(0)").append( '' );

Now I want to remove last appened element (an image). Please give sugguestions;

+4  A: 

You can use the :last-child selector to find the last appended element, then you can remove it:

$('img:last-child', this).remove();
// get the last img element of the childs of 'this'
CMS