How do I do this?

I am making a little project called “Potion Clicker” and I am wondering if there is a way to make it so
when I click on the potion (It’s an img tag) the 0 will become 1 and every time you click it goes +1 up?

Sorry I woke up really bad, so my grammar is not that good right now…

this is possible, do you use vanilla js or a library like jquery? Using jquery would make things easier

you need to add a click event, get the value from the element, and increase it by one and update the DOM

what code do you have so far?

3 Likes

Is it possible you could show me examples of the vanilla js and the jquery?

I have no code right now, I have tried multiple times but have failed so I removed those code so I could do new scripts.

i can help with your existing code, but writing code from scratch is exactly a programmers job, which is a paid job. I think there is quit a difference there

you should decide if you want to use (vanilla) JS or jquery, once you have some code, i can push you in the right direction

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.