Skip to content
Advertisement

How to keep track of a purchase total based on number of clicks

I am trying to keep track of a running total based on number of clicks on the buttons on the site. There are 8 buttons, all of which should add $123.45 to the total when clicked, as well as alert the total.

Some of my HTML

JavaScript

And my JS so far

JavaScript

I know this JS isn’t what I need, but I just wanted to put something in so I could verify the button was working.

Any advice is much appreciated, thanks!

Advertisement

Answer

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement