Are you running this code inside the <head> tag? Try wrapping it like this:
$(document).ready(function(){ $('.openInNewWindow').after('<img src="images/newWindow.gif" />'); }); Also, why are you setting the target attribute if it is already set to the same value? cheers - ricardo On Sep 22, 2:56 pm, artpunx <[EMAIL PROTECTED]> wrote: > Hello list! > > Apologies if this is a recurrent request! > > I would like to append an image after an <a href...., so far I have my > html: > > <a href="#" name="foo" target="_blank" class="openInNewWindow">open in > new window</a> > > and my first attempt at jQuery: > > $('.openInNewWindow').after('<img src="images/newWindow.gif" / > > >').attr('target','_blank'); > > ....to obtain the following: > > <a href="#" name="foo" target="_blank" class="openInNewWindow">open in > new window</a><img src="images/newWindow.gif" /> > > ....but nothing happens!!! > > Am I pointing in the right direction? > > Any advice would be greatly appreciated > > Thanks > > AMWJ