Hey all, in this JavaScript DOM tutorial I’ll introduce you to the query selector – 2 of them. The first one – document.querySelector, returns a single element. The 2nd one – document.querySelectorAll, returns multiple elements.

+ Atom editor –
+ GitHub Repo –

Other tutorials:





============== The Net Ninja =====================

For more front-end development tutorials & to black-belt your coding skills, head over to – or

================== Social Links ==================

Twitter – @TheNetNinja –


  1. Really like your tuts! A quick question about the developer tools in Chrome. When I query the DOM I get back a ton of info in the console under ''. I just want the basic tags displayed like you showed in your video. Does anyone know how to do that?

  2. Hi dude,
    I want to suggest something from this u can earn money but it needs need some effort.
    Why don't you create udemy course on web development by creating one awesome project.

    There are lot of courses which teaches the htnl css js but many don't like those course because they wanted to learn a real time project.
    So if time permits go for it.

  3. Great tuts. So, given the greater control that querySelector offers, do you still find yourself using jQuery often? If so, is the primary reason for ease of cross browser compatibility? Maybe for Ajax?

  4. Why querySelector(#book-list returned the FIRST element and not the last ? Im kind of use to in other languages that the last element that is equal to your statment is returned. JS stops at first element ?

  5. I think, it is very impotrant to add differences between querySelectorAll and other methods. querySelectorAll return a static collection, while getElementsByClassNmae return dynamic one. If some element was dunamiclly added to a page, variable, which contain collection, would dynamicly changes

  6. I highly appreciate your tutorials; they are concise, to the point and super helpful. Thanks a lot, subscribed!
    I’ve already worked through some of your JavaScript tutorials, especially through your complete ES6 tutorial. Therefore, I have a kind request: Could you please stick from now on to ES6? For someone like me to whom JavaScript/ES6 is still fairly new, it would simplify things, as I don’t have to double check whether there is an ES6 way of writing that code. Thanks!


Please enter your comment!
Please enter your name here