How to change global variables of a processing code running within an html site?

Hello everyone!

I am recently wondering if it is possible to alter the values of some global variables of a processing code running in a html page by user data input on that very html page?

I tried the follwoing: When importing an external js-code to an html code, the external js-code can access global variables declared and initialised within the js-section of the html code the external js-code is imported to. Knowing this and in regards to the problem that wants to be solved, I exluded those global variables in the processing code that are thought to be alterd by user input and declared and initialised them in the js-section of the html code instead. But this doesn’t work.

Does anyone know how to crack this nut?

Any help is much apprechiated!

Best from anrui71

if you want to your global variable be same value when you refreshed the page,you can try databases or cookies.

Can you post an example of what you’ve tried so far?

Are you using Processing, processing.js, or p5.js?

How are you getting the user input?