# How to get accordion to close when another one is opned?

**URL:** <https://community.weweb.io/t/how-to-get-accordion-to-close-when-another-one-is-opned/2584>\
**Category:** How do I?\
**Created:** [May 4, 2023, 12:39pm UTC](https://community.weweb.io/t/how-to-get-accordion-to-close-when-another-one-is-opned/2584 "2023-05-04T12:39:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Osman](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/osman/32/3225_2.png) [@Osman](https://community.weweb.io/u/Osman)\
**Post date:** [May 4, 2023, 12:39pm UTC](https://community.weweb.io/t/how-to-get-accordion-to-close-when-another-one-is-opned/2584/1 "2023-05-04T12:39:50Z")

</div>

How do I get an already open accordion to close when another one is opened?

---

<div class="post-metadata">

**Author:** ![jaredgibb](https://avatars.discourse-cdn.com/v4/letter/j/ecd19e/32.png) [@jaredgibb](https://community.weweb.io/u/jaredgibb)\
**Post date:** [May 4, 2023, 1:12pm UTC](https://community.weweb.io/t/how-to-get-accordion-to-close-when-another-one-is-opned/2584/2 "2023-05-04T13:12:02Z")

</div>

I would have a variable called “openAccordian”

I would give each accordion it’s own specific ID

I would bind the “openness” to whatever accordions I’d is stored in “openAxxordian”

openAccordian = this accordions ID
