I'm just trying out p5.js. I'd like to change some HTML text (not on the p5 canvas) from p5. Something like:
score_display = createElement("text", "Score: 0");
...
score_display.nodeValue = "Score: " + score; // doesn't work
How do I do this? Thanks.
There is an .html()
property in p5.js to change innerHTML of an element.
Admittedly difficult to find in their reference documentation. Perhaps they are deprecating? https://p5js.org/reference/#/p5.Element/html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With