Hello! It's my first time writing here, so I apologized in advance if this is the wrong place to write this. I will remove it quickly.
As far as I have tried, I can't find a way to delete DOM elements like
header = createElement('h2', 'title')
button = createButton('submit')
in sketch.js file.
Once they are created, they don't get removed by clear() or setup() functions. I tried to make customized function that reset the canvas, but those wouldn't delete the buttons or elements above.
Please let me know if there's already a way to do this easily, if not, I would love to know a way-around.
Nature of issue?
Most appropriate sub-area of p5.js?
- [ DOM elements ] Other (specify if possible)
Which platform were you using when you encountered this?
Feature enhancement details:
Cannot find how to reset/clear already created dom elements in the canvas
Hello! It's my first time writing here, so I apologized in advance if this is the wrong place to write this. I will remove it quickly.
As far as I have tried, I can't find a way to delete DOM elements like
header = createElement('h2', 'title')
button = createButton('submit')
in sketch.js file.
Once they are created, they don't get removed by clear() or setup() functions. I tried to make customized function that reset the canvas, but those wouldn't delete the buttons or elements above.
Please let me know if there's already a way to do this easily, if not, I would love to know a way-around.
Nature of issue?
Most appropriate sub-area of p5.js?
Which platform were you using when you encountered this?
Feature enhancement details:
Cannot find how to reset/clear already created dom elements in the canvas