Ruby Forum Rails Spinoffs > using element.down to find more than one element

Posted by elduderino (Guest)
on 13.05.2008 21:09
(Received via mailing list)
Hi,

This is an easy one i imagine but i can't get it working with
prototype code....i can do it with vanilla javascript.

I have div that contains a variable amount of other divs (Its variable
because this script involves draggables and droppables and the user
can drag any no of divs in to one box). I've selected the container
div ('dropp') and want to say get all the divs inside the container
and add their id to an array...

So i have this which currently doesn't work...it throws an error:

  var dropBox1contents = $('dropp').down('div');
          dropBox1contents.each(function(box) {
//add id to array here

the error is that dropbox1contents has no properties


any ideas?
Posted by Diodeus (Guest)
on 13.05.2008 21:25
(Received via mailing list)