How to access Canvas created in HTML file from script.js

I am new to p5.js and I want to access a Canvas I created in my index.html and apply the function draw on it, instead of creating a new canvas in the setup function. I tried to saved the Canvas into a variable with getElementById() but to reference to it in the draw function?

Answers

Sign In or Register to comment.