what you need is attr. to get the value of an attribution use $ ('iframe').attr('href'); to set a rel attribute use $ ('iframe').attr('rel':'myrel');
On Sep 21, 10:12 am, Andrea - Aosta <[EMAIL PROTECTED]> wrote: > I need to replace an attribute inside a tag <a... > I have this code html > > <a href="url.html" class="iframe" >Link</a> > > And, for all link with iframe class, i need to have > > <a href="iframe.html" rel="myrel" > Link </a> > > I have try with > > $(".iframe").append("rel='highslide-iframe'"); > > but this append outside the <a... > > I think this is better: > > $(".iframe").replaceWith("rel='highslide-iframe'"); > > but how to set a replace saving the url target? > Thank you