# Clone an Element jQuery problem

**URL:** <https://forum.freecodecamp.org/t/clone-an-element-jquery-problem/141884>\
**Category:** General\
**Created:** [August 15, 2017, 1:12pm UTC](https://forum.freecodecamp.org/t/clone-an-element-jquery-problem/141884 "2017-08-15T13:12:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![KB1986](https://avatars.discourse-cdn.com/v4/letter/k/13edae/32.png) [@KB1986](https://forum.freecodecamp.org/u/KB1986)\
**Post date:** [August 15, 2017, 1:12pm UTC](https://forum.freecodecamp.org/t/clone-an-element-jquery-problem/141884/1 "2017-08-15T13:12:24Z")

</div>

**Tell us what’s happening:**  
My question is about clone().appendTo. I completed the challenge to clone #target 5 from the right to the left-well, but now i see that not only target 5 is on both sides, but it’s also double on the left side.  
If i rewrite a small part of the code then the problem is gone but every new challenge i start it always comes back.  
I don’t know what i am doing wrong here…

**Your code so far**

```auto
<script>
  $(document).ready(function() {
    $("#target1").css("color", "red");
    $("#target1").prop("disabled", true);
    $("#target4").remove();
    $("#target2").appendTo("#right-well");
    $("#target5").clone().appendTo("#left-well");
    $("#target1").parent().css("background-color", "red");
    $("#right-well").children().css("color", "orange");

  });
</script>

<!-- Only change code above this line. -->

<div class="container-fluid">
  <h3 class="text-primary text-center">jQuery Playground</h3>
  <div class="row">
    <div class="col-xs-6">
      <h4>#left-well</h4>
      <div class="well" id="left-well">
        <button class="btn btn-default target" id="target1">#target1</button>
        <button class="btn btn-default target" id="target2">#target2</button>
        <button class="btn btn-default target" id="target3">#target3</button>
      </div>
    </div>
    <div class="col-xs-6">
      <h4>#right-well</h4>
      <div class="well" id="right-well">
        <button class="btn btn-default target" id="target4">#target4</button>
        <button class="btn btn-default target" id="target5">#target5</button>
        <button class="btn btn-default target" id="target6">#target6</button>
      </div>
    </div>
  </div>
</div>
```

---

<div class="post-metadata">

**Author:** ![ckingbailey](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ckingbailey/32/30571_2.png) [@ckingbailey](https://forum.freecodecamp.org/u/ckingbailey)\
**Post date:** [September 2, 2017, 9:27pm UTC](https://forum.freecodecamp.org/t/clone-an-element-jquery-problem/141884/2 "2017-09-02T21:27:55Z")

</div>

@KB1986 could you provide a link to the lesson this is from?

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 17, 2021, 8:40pm UTC](https://forum.freecodecamp.org/t/clone-an-element-jquery-problem/141884/3 "2021-01-17T20:40:36Z")

</div>

Closed on January 17, 2021, 8:40pm UTC


