0

can you explain dom elements to me ?

hello guys i dont understand this, can someone explain it to me plz element.childNodes returns an array of an element's child nodes. element.firstChild returns the first child node of an element. element.lastChild returns the last child node of an element. element.hasChildNodes returns true if an element has any child nodes, otherwise false. element.nextSibling returns the next node at the same tree level. element.previousSibling returns the previous node at the same tree level. element.parentNode returns the parent node of an element.

9th May 2020, 11:42 AM
zinwar zardasht
zinwar zardasht - avatar
1 Answer
+ 1
https://javascript.info/dom-navigation This will help you Also I would advise you to use code playground and keep checking what elements are in an array of a element ,
9th May 2020, 11:50 AM
Abhay
Abhay - avatar