Closed Kinrany closed 6 years ago
In new p5(sketch, element) the element parameter can be either an id attribute or an HTMLElement object.
new p5(sketch, element)
element
HTMLElement
Using an id causes all canvas elements be parented to the first element in the document with that id.
Food for thought: new p5(...) has exactly two parameters: where to mount and what to render.
new p5(...)
Like a Vue app. Or a Cycle component.
In
new p5(sketch, element)
theelement
parameter can be either an id attribute or anHTMLElement
object.Using an id causes all canvas elements be parented to the first element in the document with that id.