Thank you that worked!!!

I think I may understand how to use children if you could also show
how to get the img src attrbitute when 'this' contains:

<div class="logo">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td height="170" align="center" valign="middle"><img src="/
images/somelogo.gif" /><br />
        <a href="http://www.test.org"; target="_blank">Test Logo</a></
td>
    </tr>
  </table>
</div>



On Jun 14, 9:25 am, Erik Beeson <erik.bee...@gmail.com> wrote:
> Like MorningZ said, more info would be helpful, but this should work:
>
> $('#output').html('SRC: ' + $(this).children('img').attr('src'));
>
> --Erik
>
> On Sun, Jun 14, 2009 at 7:02 AM, Logictrap <dlyck...@gmail.com> wrote:
>
> > I need to get the src attribute of an img element that is a sub-
> > element of 'this' but I can't figure out how to traverse 'this' to get
> > there.
>
> > The contents of 'this' are:
>
> >     <div id="test1"><img src="images/beach1.jpg" width="200"
> > height="200" alt="beach" /></div>
>
> > this works:
>
> >     $('#output').html("ID: " + this.id);
>
> > This does not:
>
> >     $('#output').html("SRC: " + this.img.src);
>
> > How do I get the contents of the img.src attribute'?

Reply via email to