1. 2
    Select an HTML Element with document.querySelector
    1m 4s

Select an HTML Element with document.querySelector

InstructorIan Jones

Share this video with your friends

Send Tweet

You can use document.querySelector to fetch elements from your HTML document.

In this lesson, we pass an Id to querySelector indicated with a #.

document.querySelector('#movie-2').

querySelector will return the first element that it matched.