# (Solved) How to close/open element with same click

**URL:** <https://forum.bubble.io/t/solved-how-to-close-open-element-with-same-click/4354>\
**Category:** Uncategorized\
**Created:** [July 14, 2016, 8:12am UTC](https://forum.bubble.io/t/solved-how-to-close-open-element-with-same-click/4354 "2016-07-14T08:12:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexsstockton](https://avatars.discourse-cdn.com/v4/letter/a/aca169/32.png) [@alexsstockton](https://forum.bubble.io/u/alexsstockton)\
**Post date:** [July 14, 2016, 8:12am UTC](https://forum.bubble.io/t/solved-how-to-close-open-element-with-same-click/4354/1 "2016-07-14T08:12:13Z")

</div>

I want to have a user able to click on an element to view more info and then click it a second time to hide the info. I’m guessing this has something to do with custom states, but I wanted to post the question on the forum.

---

<div class="post-metadata">

**Author:** ![csblack](https://avatars.discourse-cdn.com/v4/letter/c/7feea3/32.png) [@csblack](https://forum.bubble.io/u/csblack)\
**Post date:** [July 14, 2016, 9:41am UTC](https://forum.bubble.io/t/solved-how-to-close-open-element-with-same-click/4354/2 "2016-07-14T09:41:15Z")

</div>

Although this could be done via a custom state I would just do a conditional… When the button is pressed, and X is not visible, show X. When the button is pressed and X is visible, hide X.

You could trigger a custom state. and then set the element to be visible based on the state. But this would require a conditional anyway.

---

<div class="post-metadata">

**Author:** ![kfhwdd](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/kfhwdd/32/2166_2.png) [@kfhwdd](https://forum.bubble.io/u/kfhwdd)\
**Post date:** [July 14, 2016, 3:07pm UTC](https://forum.bubble.io/t/solved-how-to-close-open-element-with-same-click/4354/3 "2016-07-14T15:07:15Z")

</div>

I found this YouTube tutorial the other day. It uses a button to show and hide text.

I think you can use the exact same method to achieve what you’re describing, take a look:

---

<div class="post-metadata">

**Author:** ![alexsstockton](https://avatars.discourse-cdn.com/v4/letter/a/aca169/32.png) [@alexsstockton](https://forum.bubble.io/u/alexsstockton)\
**Post date:** [July 14, 2016, 3:27pm UTC](https://forum.bubble.io/t/solved-how-to-close-open-element-with-same-click/4354/4 "2016-07-14T15:27:11Z")

</div>

Lol, I don’t know how I missed this very obvious solution. Thanks!
