Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jmlavoier/e9024616890df22f1daca232a979d811 to your computer and use it in GitHub Desktop.
Save jmlavoier/e9024616890df22f1daca232a979d811 to your computer and use it in GitHub Desktop.
let p = document.querySelector('.content > p');
console.log(document.parentNode); // <div id="cont" class="content">...</div>
console.log(document.parentElement); // <div id="cont" class="content">...</div>
@nltncsr
Copy link

nltncsr commented Jul 2, 2017

Acredito que tu esteja pegando os atributos do elemento errado 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment