Tuesday, December 10, 2019

Module 4: Traversing and Removing Nodes

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.

No comments:

Post a Comment

Arrays 4 : Callback Methods find() filter() some() every() sort()

  /* Callback Methods */ // const util = { // findBurgRating: function(singleFeedback) { // return singleFeedback.comment....