# \[SOLVED\] jQuery .hide() or .remove()

**URL:** <https://forum.freecodecamp.org/t/solved-jquery-hide-or-remove/86315>\
**Category:** General\
**Created:** [February 11, 2017, 11:27pm UTC](https://forum.freecodecamp.org/t/solved-jquery-hide-or-remove/86315 "2017-02-11T23:27:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicolegrima](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/nicolegrima/32/37550_2.png) [@nicolegrima](https://forum.freecodecamp.org/u/nicolegrima)\
**Post date:** [February 11, 2017, 11:27pm UTC](https://forum.freecodecamp.org/t/solved-jquery-hide-or-remove/86315/1 "2017-02-11T23:27:59Z")

</div>

I’m running into a jQuery issue - and I’m not sure what I am doing wrong!  
Trying to figure it out on this codepen here -

> **[Golf Code TESTING](https://codepen.io/nicolegrima/pen/NdeWmR)**
>
> ...

  
Basically when I CLICK submit - I want a FUNCTION to run. I also want to hide/ remove some elements and replace them down the line with the result from the function. But first I need to figure out how to HIDE/ REMOVE.

Can you add something like this in a function? $(“p”).remove();

---

<div class="post-metadata">

**Author:** ![ouauo](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ouauo/32/74355_2.png) [@ouauo](https://forum.freecodecamp.org/u/ouauo)\
**Post date:** [February 12, 2017, 12:08am UTC](https://forum.freecodecamp.org/t/solved-jquery-hide-or-remove/86315/2 "2017-02-12T00:08:08Z")

</div>

Somthing like this?

[http://codepen.io/ouauo/pen/bgOddM](http://codepen.io/ouauo/pen/bgOddM)

---

<div class="post-metadata">

**Author:** ![nicolegrima](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/nicolegrima/32/37550_2.png) [@nicolegrima](https://forum.freecodecamp.org/u/nicolegrima)\
**Post date:** [February 12, 2017, 1:41am UTC](https://forum.freecodecamp.org/t/solved-jquery-hide-or-remove/86315/3 "2017-02-12T01:41:20Z")

</div>

YES!! I kept tinkering about with the code and my hide() would only work once I moved the button element out of the form… not sure why.

---

<div class="post-metadata">

**Author:** ![nicolegrima](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/nicolegrima/32/37550_2.png) [@nicolegrima](https://forum.freecodecamp.org/u/nicolegrima)\
**Post date:** [February 12, 2017, 1:42am UTC](https://forum.freecodecamp.org/t/solved-jquery-hide-or-remove/86315/4 "2017-02-12T01:42:44Z")

</div>

I like ur solution - gonna compare it to what I’ve been doing too! THANK YOU!!! 🙂

---

<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 16, 2021, 5:24pm UTC](https://forum.freecodecamp.org/t/solved-jquery-hide-or-remove/86315/5 "2021-01-16T17:24:32Z")

</div>

Closed on January 16, 2021, 5:24pm UTC


