querySelector
will select
the first HTML element which matches the
provided query and ignore the rest.
This is a versatile
selector
and
can match using any of the
CSS selectors. It can use class name, tag name,
id name or any complex selector too.
The selectors that we pass in this
method are simply the selectors
that we have used in CSS. This means you
can use #
to select using the id, .
to
select the elements using their class.
You can go as detailed as possible
with your selectors.
For example, the inspirationConfirmation
variable gets its value through a complex
CSS selector in document.querySelector('#brutal-paragraph>span')
.