--- id: bad87fee1348bd9aed608826 title: Usare appendTo per spostare gli elementi con jQuery challengeType: 6 forumTopicId: 18340 dashedName: use-appendto-to-move-elements-with-jquery --- # --description-- Ora proviamo a spostare gli elementi da un `div` ad un altro. jQuery ha una funzione chiamata `appendTo()` che consente di selezionare elementi HTML e aggiungerli ad un altro elemento. Per esempio, se volessimo spostare `target4` dal nostro well di destra a quello di sinistra, potremmo usare: ```js $("#target4").appendTo("#left-well"); ``` Sposta il tuo elemento `target2` dal `left-well` al `right-well`. # --hints-- Il tuo elemento `target2` non dovrebbe essere all'interno del `left-well`. ```js assert($('#left-well').children('#target2').length === 0); ``` Il tuo elemento `target2` dovrebbe essere all'interno del `right-well`. ```js assert($('#right-well').children('#target2').length > 0); ``` Dovresti usare solo jQuery per spostare questi elementi. ```js assert(!code.match(/class.*animated/g)); ``` # --seed-- ## --seed-contents-- ```html