Oh, shoot-- you're right, it does work.

The issue I'm actually having is that $$('img:not(#bag img)') returns
all imgs including #bag img... but I don't think using two selectors
is actually supported. (Someone tell me if I'm wrong!)

Thanks for your help!

On Jun 28, 12:42 pm, Diodeus <[EMAIL PROTECTED]> wrote:
> This successfully alerted the image source name:
>
> <div id="foo">
> <img id="image" src="blah.jpg">
> <div id="bar"
> </div>
> <script language=javascript>
> var thing = $$('#foo img')
> alert(thing[0].src)
> </script>
>
> If it doesn't work for you maybe you should grab a fresh copy of
> Prototype.
>
> On Jun 28, 3:30 pm, Kalvin <[EMAIL PROTECTED]> wrote:
>
> > I can't access an img inside a div using the $$() syntax. Using
> > getElementsBySelector doesn't work either. Both return empty arrays. I
> > can access it with getElementById, however.
>
> > <div id="foo">
> > <img id="image" src="blah.jpg">
> > <div id="bar"
> > </div>
>
> > - Using $$('#foo img') returns an empty array
> > - Using $('foo').getElementsBySelector('img') gets me an empty array
> > - Using $('foo').childElements() gets me an array with 'blah'
> > inside... but not the img.
> > - Using $('image') works.
>
> > To me, it looks like img doesn't count as an element of any kind. But
> > I don't see how that's possible, and from the docs it doesn't look
> > like it's supposed to work that way. Is this a bug or am I missing
> > something?
>
> > Thanks for your help!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to