# Altering global variables of a processing code running via processing.js within an html page

**URL:** https://discourse.processing.org/t/altering-global-variables-of-a-processing-code-running-via-processing-js-within-an-html-page/38330
**Category:** Coding Questions
**Created:** [August 12, 2022, 8:53pm UTC](https://discourse.processing.org/t/altering-global-variables-of-a-processing-code-running-via-processing-js-within-an-html-page/38330 "2022-08-12T20:53:33Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![anrui71](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@anrui71](https://discourse.processing.org/u/anrui71)
#### Post date: [August 12, 2022, 8:53pm UTC](https://discourse.processing.org/t/altering-global-variables-of-a-processing-code-running-via-processing-js-within-an-html-page/38330/1 "2022-08-12T20:53:33Z")

</div>

Hello everyone,

I am currently trying to find a way to alter the values of some global variables of a processing code running in an html page through user value input on the html page.

Generally, when importing an separate javascript-code-file to an html page, this javascript-code can access global variables declared and initialised within the javascript-section of the html page. So I exluded those global variables in the processing code that are thought to be altered by user input and declared and initialised them in the javascript-section of the html code instead. But this doesn’t work.

If anyone knows about the correct way to solve this problem, help is much apprechiated!!

All the best,  
anrui71
