r/JavaScriptTips • • Dec 06 '23

How do I do this?

What is the code for this function? The website didn't tell me.

13 Upvotes

11 comments sorted by

View all comments

5

u/CrackedTV Dec 06 '23

I would have a variable that adds +1 to a number every time you click that button and changes the inner HTML of that "button" with each number.

It's a very unnecessary way to do it but with this you can start.