0
What is a child node ?
Can you explain it elaborately. I can't understand it
2 odpowiedzi
+ 1
[Part 2]
Let's say there's a truck, which holds boxes of ice cream. Applying the same principle, the boxes are "children" of the truck and the ice creams are the "children" of the boxes.
The truck is on the outside so it's on one level. The boxes are inside the truck and so they are in another level. The ice creams are yet in another level since they're children of the boxes.
All the ice creams are siblings, but they're not siblings with the boxes or truck. All the boxes are siblings, but they aren't siblings of the ice creams or truck. Same goes for the truck.
The reason for this siblings thing is that items/elements in the same level are siblings.
Or to make it simpler, think of it as a family where each generation is a level.
+ 1
It's simple yet slightly daring for beginners.
Let's say you have a box of Lego pieces. The box now is the "container" and it "contains" the nails. This could be thought of as the box is the "parent" of the Lego pieces and they are therefore its "children". Since all of them are only inside the box and not further inside something else, then they are all "siblings" to one another.
This principle applies to DOM in websites and to networking and telecommunications.