--- id: bad87fee1348bd9aed508826 challengeType: 6 forumTopicId: 16780 title: 使用 jQuery 克隆元素 --- ## Description
除了移动标签,也可以把元素从一个地方复制到另一地方。 jQuery 有一个clone()方法,可以复制标签。 例如,如果想把target2left-well复制到right-well,可以设置如下: $("#target2").clone().appendTo("#right-well"); 你是否注意到这两个 jQuery 方法连在一起了吗?这被称为链式调用(function chaining),是一种用 jQuery 实现效果的简便方法。 克隆target5标签并附加到left-well
## Instructions
## Tests
```yml tests: - text: target5标签应该在right-well内。 testString: assert($("#right-well").children("#target5").length > 0); - text: 克隆target5标签并放在left-well内。 testString: assert($("#left-well").children("#target5").length > 0); - text: 仅用 jQuery 移动这些标签。 testString: assert(!code.match(/class.*animated/g)); ```
## Challenge Seed
```html

jQuery Playground

#left-well

#right-well

```
## Solution
```html

jQuery Playground

#left-well

#right-well

```