Reference child()

child()

Attaches the element as a child of another element.

myElement.child() accepts either a string ID, DOM node, or p5.Element. For example, myElement.child(otherElement). If no argument is provided, an array of children DOM nodes is returned.

Examples

Syntax

child()
child([child])

Parameters

child
String|p5.Element:

the ID, DOM node, or p5.Element to add to the current element

Notice any errors or typos? Please let us know. Please feel free to edit src/dom/dom.js and open a pull request!

Related References