# Target the Parent of an Element Using jQuery | Help

**URL:** <https://forum.freecodecamp.org/t/target-the-parent-of-an-element-using-jquery-help/168993>\
**Category:** General\
**Created:** [January 16, 2018, 6:04am UTC](https://forum.freecodecamp.org/t/target-the-parent-of-an-element-using-jquery-help/168993 "2018-01-16T06:04:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![iamtheonewhocodes](https://avatars.discourse-cdn.com/v4/letter/i/839c29/32.png) [@iamtheonewhocodes](https://forum.freecodecamp.org/u/iamtheonewhocodes)\
**Post date:** [January 16, 2018, 6:04am UTC](https://forum.freecodecamp.org/t/target-the-parent-of-an-element-using-jquery-help/168993/1 "2018-01-16T06:04:38Z")

</div>

**Tell us what’s happening:**

![00 AM](https://global.discourse-cdn.com/freecodecamp/original/3X/5/b/5bcb82ac5d1912178fdc28145b2dd9bc6abed3d3.png)

**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");
    $("#left-well").parent().css("background-color", "red")
    

  });
</script>

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

<body>
  <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>
</body>

```

**Your browser information:**

Your Browser User Agent is: `Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:57.0) Gecko/20100101 Firefox/57.0`.

**Link to the challenge:**  
[https://www.freecodecamp.org/challenges/target-the-parent-of-an-element-using-jquery](https://www.freecodecamp.org/challenges/target-the-parent-of-an-element-using-jquery)

---

<div class="post-metadata">

**Author:** ![LGW86A](https://avatars.discourse-cdn.com/v4/letter/l/3ec8ea/32.png) [@LGW86A](https://forum.freecodecamp.org/u/LGW86A)\
**Post date:** [January 16, 2018, 1:25pm UTC](https://forum.freecodecamp.org/t/target-the-parent-of-an-element-using-jquery-help/168993/2 "2018-01-16T13:25:09Z")

</div>

You shouldn’t be selecting `#left-well`'s parent, you need to select `#target1`'s parent.

---

<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:30pm UTC](https://forum.freecodecamp.org/t/target-the-parent-of-an-element-using-jquery-help/168993/3 "2021-01-17T20:30:16Z")

</div>

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


