# Remove item from the list after click on button

**URL:** <https://community.hubspot.com/t/remove-item-from-the-list-after-click-on-button/79042>\
**Category:** CMS Development\
**Tags:** professional\
**Created:** [April 11, 2023, 9:06am UTC](https://community.hubspot.com/t/remove-item-from-the-list-after-click-on-button/79042 "2023-04-11T09:06:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sapna1](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/sapna1/32/71182_2.png) [@Sapna1](https://community.hubspot.com/u/Sapna1)\
**Post date:** [April 11, 2023, 9:06am UTC](https://community.hubspot.com/t/remove-item-from-the-list-after-click-on-button/79042/1 "2023-04-11T09:06:23Z")

</div>

I want to remove a item from the list after click on button in cms hub.

---

<div class="post-metadata">

**Author:** ![andreaska](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/andreaska/32/198312_2.png) [@andreaska](https://community.hubspot.com/u/andreaska)\
**Post date:** [April 11, 2023, 1:42pm UTC](https://community.hubspot.com/t/remove-item-from-the-list-after-click-on-button/79042/2 "2023-04-11T13:42:45Z")

</div>

Hi, could you please add more details to your problem description/question? Thanks

---

<div class="post-metadata">

**Author:** ![Sapna1](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/sapna1/32/71182_2.png) [@Sapna1](https://community.hubspot.com/u/Sapna1)\
**Post date:** [April 13, 2023, 6:34am UTC](https://community.hubspot.com/t/remove-item-from-the-list-after-click-on-button/79042/3 "2023-04-13T06:34:33Z")

</div>

![Sapna1_0-1681367585639.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/2/2a0f19b029a15731f073a219a48058a5b151770d.png)

Hello

from this attechment, i want to remove after click on href, data remove from the list according to id.

---

<div class="post-metadata">

**Author:** ![andreaska](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/andreaska/32/198312_2.png) [@andreaska](https://community.hubspot.com/u/andreaska)\
**Post date:** [April 13, 2023, 6:46am UTC](https://community.hubspot.com/t/remove-item-from-the-list-after-click-on-button/79042/4 "2023-04-13T06:46:02Z")

</div>

Hi @Sapna1. it is still hard to follow what your exact problem is. Anyhow, I will try to give you a rough outline of how you can achieve that.

1. Each row in your HTML table or list should have a unique id (e.g. \<div id=“record-12345”\>\</div\>)
2. Your “Remove” button should have a common CSS class (e.g. \<a class=“remove-button” …\>Remove\</a\>)
3. Add custom javascript to listen for a click on “Remove” buttons (e.g. jQuery(‘.remove-button’).on(‘click’, function() { [add your code here] }) )
4. In the event handler:
  1. Find the parent div containing the record id
  2. Optionally, make an AJAX call to remove the record on the server side
  3. Remove the DOM element with .remove()

I hope this helps you in some way.
