Using HTML button element to change a variable in the Javascript

telstartelstar
Sat, 22 Nov 2025 16:40:55 +0000
Beginners

Hi again!
For another part of my project I’m trying to figure out how to use a element in the HTML of my sketch to change a set variable in my Javascript. In specific I’m using it to change the background image variable of the Javascript, but I’m not finding anything in the documentation that helps me figure out what to put in the “onclick=” part of the element that can lead it to the variable in my javascript.
I’m wondering if it’s even a possibility at this point, but I’m very stumped at this part.

4 posts - 2 participants