const wes = document.querySelector('.wes');
console.log(wes.children);
//Will show just the child elements.
wes.firstChildElement;
wes.lastElementChild;
wes.previousElementSibling;
wes.nextElementSibling;
wes.parentElement;
console.log(wes.childNodes);
//Will show all the nodes under the element.
console.log(wes.children);
//Will show just the child elements.
wes.firstChildElement;
wes.lastElementChild;
wes.previousElementSibling;
wes.nextElementSibling;
wes.parentElement;
console.log(wes.childNodes);
//Will show all the nodes under the element.
No comments:
Post a Comment