[jQuery] Move element to parent div

2009-05-19 Thread aly
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

[jQuery] Re: Move element to parent div

2009-05-19 Thread aly
, 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

[jQuery] Re: Move element to parent div

2009-05-19 Thread aly
... On 19 Mai, 19:44, Richard D. Worth rdwo...@gmail.com wrote: On Tue, May 19, 2009 at 10:48 AM, aly he...@digitalnature.ro wrote: thanks for your reply. html is something like: div class=mydivcontainer  ...  div class=mydiv     ...  /div /div there are more elements where I

[jQuery] Re: Move element to parent div

2009-05-19 Thread aly
doesnt work. I get: Error: [Exception... Node cannot be inserted at the specified point in the hierarchy code: 3 . On 19 Mai, 20:43, Richard D. Worth rdwo...@gmail.com wrote: How about (untested): $(this).parent().prepend(this) ? - Richard On Tue, May 19, 2009 at 1:29 PM, aly he

[jQuery] Re: Move element to parent div

2009-05-19 Thread aly
found it: jQuery(this).prependTo(this.parentNode) works! thanks On 19 Mai, 20:43, Richard D. Worth rdwo...@gmail.com wrote: How about (untested): $(this).parent().prepend(this) ? - Richard On Tue, May 19, 2009 at 1:29 PM, aly he...@digitalnature.ro wrote: it seems that parent