The parent() function is used to attach the element as a parent element. This function accepts either a string ID, DOM node, or p5.Element. This function returns the parent node if it does not contain any parameters.
parent( parent )
Parameters: It contains single parameter parent which holds the string|p5.Element|Object as element.
Below example illustrates the parent() function in p5.js:
- Call a parent window function from an iframe
- SASS | Parent Selector
- How to add a parent to several tags in HTML ?
- jQuery | :parent Selector
- jQuery | parent descendant Selector
- How to clear all div's content inside a parent div ?
- HTML | DOM Window parent Property
- jQuery | parent() & parents() with Examples
- JQuery | Get the n-th level parent of an element
- jQuery | parent > child Selector
- How to apply style to parent if it has child with CSS?
- How to make flexbox children 100% height of their parent using CSS?
- How to refresh parent page on closing a popup ?
- How to get position of an element relative to the document or parent using jQuery ?
- How to remove parent element except its child element using jQuery ?
- How to communicate from parent component to the child component in Angular 9 ?
- How to navigate to a parent route from a child route?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.