Adds the given element to the DOM. If a parent is provided the element is added as a child of the parent, providing it was able to access it.
If no parent was given it falls back to using document.body
.
name | type | arguments | description |
---|---|---|---|
element | HTMLElement |
The element to be added to the DOM. Usually a Canvas object. |
|
parent | string | HTMLElement | <optional> |
The parent in which to add the element. Can be a string which is passed to |
The element that was added to the DOM.