What does your html look like? Is .mydivcontainer the immediate parent of
.mydiv?

- Richard

On Tue, May 19, 2009 at 7:20 AM, aly <he...@digitalnature.ro> wrote:

>
>
> I'm trying to move a set of divs into their parent elements.
>
> Currently I'm using:
> jQuery('.mydiv').each(function(){ jQuery(this).prependTo
> ('.mydivcontainer').remove();  });
>
> this works somehow, but the problem is that all elements on the page
> with class .mydiv are inserted into each .mydivcontainer element.
>
> to avoid this, I tried prepending .mydiv to its parent;
>  jQuery('.mydiv').each(function(){ jQuery(this).prependTo(jQuery
> (this).parent('.mydivcontainer')).remove();  });
>
> but for some weird reason it doesn't work, .mydiv doesn't show up :(
>
> can anyone help me with this?
> thanks :D
>

Reply via email to