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.
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)