I have a page which has a list of products. For each product, I have a button (Add to Cart).
Once a user clicks on this button the product gets added on a side panel (aka cart). This side panel has:
- Quantities to be changed
- Delete icon - in case user wants to remove the product from the cart. So, these delete icons are created run time every time a user adds the product to the cart.
Now, I have an event listener in my JS which would listen to click on the delete icon and then remove the product. But, any clicks on the delete icons are not getting responded.
Funny thing is if I take the same JS code and use it in Chrome console it works. Any idea why this is not working ?