JavaScript JavaScript and the DOM Getting a Handle on the DOM Using CSS Queries to Select Page Elements

guram dgebuadze
guram dgebuadze
Front End Web Development Techdegree Student 4,122 Points

querySelectorAll(' '); While writing this we need css selectors and why do we need > to refer to the child of the elemen

for example querySelectorAll(' #nav > p'); > why do we use this thing in js to refer to child of the nav id, while we don't use it when we are writing in css?

2 Answers