Attaches the element to a parent element.
For example, a
<div></div> is the parent element of both the header and paragraph.The parameter parent can have one of three types. parent can be a string with the parent element's ID, as in myElement.parent('container'). It can also be another p5.Element object, as in myElement.parent(myDiv). Finally, parent can be an HTMLElement object, as in myElement.parent(anotherElement).
Calling myElement.parent() without an argument returns the element's parent.
Examples
Syntax
parent(parent)parent()Parameters
parent
String|p5.Element|Object:
ID, p5.Element, or HTMLElement of desired parent element.
Notice any errors or typos? Please let us know. Please feel free to edit src/core/p5.Element.js and open a pull request!