Hey,

I would change your .parents("a") to .parent() (unless you expect the
img to be buried sometimes..).

But to get the title, do this.parents("a").attr("title");

- Jamie Goodfellow



On Feb 15, 4:44 pm, Steve Davis <[EMAIL PROTECTED]> wrote:
> i have a table of linkedthumbnailed images like this...
>
> <a href="top_shelf.html" title="Top Shelf Cocktail Bar"
> rel="top_shelf.html" class="cluetip"><img src="images/beverages.jpg"
> width="150" /></a>
>
> i want to dynamically add a text description below each image using
> the "title" attribute from the image's parent link, so it looks like
> this...
>
> <a href="top_shelf.html" title="Top Shelf Cocktail Bar"
> rel="top_shelf.html" class="cluetip"><img src="images/beverages.jpg"
> width="150" /></a>
>
> here's my code...
>
> $("a.cluetip img").each(function(i) {
>      $(this).after(this.parents("a").title);
>
> });
>
> that's not working. what am i doing wrong? i basically am just trying
> to reference the "img" first parent, the "a" tag, and pull its title.

Reply via email to