querySelector scoped inside an element

The querySelector and querySelectorAll methods are available on all DOM elements. If you call the method from a DOM element rather than from the document, only child elements will be searched.

These boxes will change because they're inside the first-line div:

First
Second
Third

These boxes won't change:

First
Second
Third