0

Im building a shopping cart.

I want to loop through a series of html elements with a class "ADD-BTN". Then i want to get the parent element which is a div box for my product sold. Im trying this using for loop.

After looping through them, I want to retrieve a price-tag which is the child of that parent.

  • look into [closest](http://developer.mozilla.org/en-US/docs/Web/API/Element/closest) for getting a parent and [querySelector](http://developer.mozilla.org/en-US/docs/Web/API/Element/querySelector) for a child. – Sheraff May 22 '22 at 12:24

0 Answers0