0
JS
How to make a button that can add value? Like when I click the button I got 10, then if I click the button again I got 20, then 30 40...
1 Antwort
0
Create a variable, initialized by 0 (zero). Let's call it <num>.
Create a function which adds 10 to <num> on each invocation.
Either call that function by using the "onclick" attribute of the button, or add an event listener on "click" event for the button as the DOM is completely loaded.
I see you have finished HTML course and got the certificate. I suggest you to review the course, especially on DOM related chapters.