I don't have anchor, only tag. See my first post: I put the code. But thanks Evo-2 give me the solution.
jlebrech wrote: > > > where your anchor tag? > >> Date: Wed, 8 Apr 2009 02:59:08 -0700 >> From: ayssel...@gmail.com >> To: jquery-en@googlegroups.com >> Subject: [jQuery] Re: addClass on ahref link on the fly >> >> >> >> Thanks for the quick reply evo-2 : it's run! I've tried this before but >> not >> with the ul balise maybe why it doesn't work? >> >> Good day ! >> >> >> evo-2 wrote: >> > >> > >> > $("ul li a").each(function(){ >> > $(this).addClass("tooptip2"); >> > }); >> > >> > Aysseline wrote: >> >> Hi >> >> >> >> I've got a list of image with links and need to add a class on the fly >> >> on >> >> the ahref link. The output is like that >> >> <ul> >> >> <li> http://www.site.com/ http://www.imageurl.com/img.png </li> >> >> <li> http://www.site.com/ http://www.imageurl.com/img.png </li> >> >> <li> http://www.site.com/ http://www.imageurl.com/img.png </li></ul> >> >> >> >> and I want this (class="tooltip2") : >> >> <ul> >> >> <li> http://www.site.com/ http://www.imageurl.com/img.png </li> >> >> <li> http://www.site.com/ http://www.imageurl.com/img.png </li> >> >> <li> http://www.site.com/ http://www.imageurl.com/img.png </li></ul> >> >> >> >> I need to do this because all is auto-generated I can only add this >> class >> >> with jQuery. I tried different code but my knowledge isn't sufficient >> >> >> >> jQuery(".gallery li a[href^='url']").addClass("tooltip"); or >> >> jQuery(".gallery li a").each(function() { >> >> jQuery(this).attr("href").addClass("tooltip"); }); >> >> >> >> and many other tricks doesn't work. I need help to achieve this, >> thanks >> >> >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/addClass-on-ahref-link-on-the-fly-tp22946637s27240p22947135.html >> Sent from the jQuery General Discussion mailing list archive at >> Nabble.com. >> > > _________________________________________________________________ > Share your photos with Windows Live Photos – Free. > http://clk.atdmt.com/UKM/go/134665338/direct/01/ > -- View this message in context: http://www.nabble.com/addClass-on-ahref-link-on-the-fly-tp22946637s27240p22948529.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.