+ 1

definition of child element and parent element i don't understand

16th Oct 2016, 10:27 AM
Vishal Sharma
Vishal Sharma - avatar
1 Answer
+ 3
¿Remember the graphical representation of the DOM of a web page? It's like a represantion of a genealogical tree. Whatever is behind a node are children of that node and whatever is over a node is the parent of a node, beeing the <html> the big granpa of all elements without any parent ;-) For example, <html> <body> <p>Hi.. I'm a child of body, and body is a child of html... Body is my parent... html could be my granpa but I don't have to worry about that as there is not granpa function selection neither a granson selection or whatever..</p> <p>Hi there... I 'm also a body's child and a sibling of the previous p element.. by the way.. I don't have children neither my brother</p> </body> </html>
16th Oct 2016, 11:01 AM
Nelson Urbina
Nelson Urbina - avatar