Moving a div from inside one div to another div using Prototype?

后端 未结 4 1784
盖世英雄少女心
盖世英雄少女心 2020-12-28 18:25

In prototype or normal-but-cross-browser-compatible Javascript, how do I move the contents of a div to the contents of another div?

Inside the div is a form with ids

4条回答
  •  囚心锁ツ
    2020-12-28 18:51

    To move the contents of here into there, this works, as long as here encloses everything you want to move, like a

    :

    $('there').insert($('here').descendants()[0]);
    

    descendants() returns an array, and insert takes content, so use the first element.

提交回复
热议问题