In JavaScript if we want to select an element inside our DOM and for example we want to change the color, we can do it this way
The document object contains the method querySelector that allows us to point to the element that we want to
As in the example above we pass inside querySelector("ID / CLASS / TAG / and ATTRIBUTE but just [INSIDE SQUARE BRACKETS ]")
No matter how many elements match our call; will always be selected the first starting from the root element and down to the last element
There are other ways to select multiple items at once but we'll talk about it in another moment (querySelectorAll).
In the example above we see that every element has the querySelector method too so we may select an element children through its father without going through the root element and going down the whole tree.

How to reduce TTFB
In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.
In this article, we’ll see how we can identify what makes our TTFB high so we can fix it.
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)