# Obtaining ID of dynamically generated button after click

**URL:** <https://community.plotly.com/t/obtaining-id-of-dynamically-generated-button-after-click/85705>\
**Category:** Dash Python\
**Created:** [July 9, 2024, 7:25pm UTC](https://community.plotly.com/t/obtaining-id-of-dynamically-generated-button-after-click/85705 "2024-07-09T19:25:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Conor](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/conor/32/28261_2.png) [@Conor](https://community.plotly.com/u/Conor)\
**Post date:** [July 9, 2024, 7:25pm UTC](https://community.plotly.com/t/obtaining-id-of-dynamically-generated-button-after-click/85705/1 "2024-07-09T19:25:33Z")

</div>

Hello everyone, I am a bit new to Dash, so I apologize if this question has a simple answer.

Pretty much I am working on an interface that has tags/buttons dynamically created based on user input. The idea is that if a specific tag is clicked on, it will be removed from the interface.

The issue is that since the button tags are generated dynamically, I have no reliable way to predict what the id of every tag will be. Is there a way for button presses to be identified in such a way that allows me to know which tag was clicked, without also knowing the ids of the buttons in advance?

---

<div class="post-metadata">

**Author:** ![AnnMarieW](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@AnnMarieW](https://community.plotly.com/u/AnnMarieW)\
**Post date:** [July 9, 2024, 7:40pm UTC](https://community.plotly.com/t/obtaining-id-of-dynamically-generated-button-after-click/85705/2 "2024-07-09T19:40:04Z")

</div>

Hi @Conor and welcome to Dash 🙂

Pattern matching callbacks might work for you. Here’s an example

> **[Pattern-match](https://dash-example-index.herokuapp.com/pattern-match)**
>
> This app demonstrates pattern matching callbacks which dynamically adds or deletes components. It has a top-bottom layout and a pattern matching callback.
