removeElements

Static removeElements 

Source
pub static removeElements: RemoveElementsInternalType
Expand description

Removes all elements created by p5, except any canvas / graphics elements created by createCanvas or createGraphics. Event handlers are removed, and element is removed from the DOM.

Examples

function setup() {
  createCanvas(100, 100);
  createDiv('this is some text');
  createP('this is a paragraph');
}
function mousePressed() {
  removeElements(); // this will remove the div and p, not canvas
}