I have been stuck on coding a tip button for my shopping cart I have been working on. The cartRows with associated images, quantity, and price are added upon clicking the Add To Cart button. From there subtotal, tax, delivery fee, and total can be easily calculated.
I was wondering how to code for a tip. A button would be pressed after the user enters a custom tip, but I can’t get anything to work so far. The code for generating a tip is placed within a for loop, I think I’m getting stuck there, how to account for a button within a for loop, I can’t find any resources to help and I’ve been searching for a week or so.
The link to my code is here: https://codepen.io/emilysarah1/pen/jOyGRXg