0
What is querySelector in Javascript?
I have seen in many codes that people use querySelector like document.querySelector(). Please help me to understand this
1 ответ
+ 1
querySelector select an html element (return first encoutered dom reference) according to the given query string (css selector syntax) argument...
querySelectorAll do the same, but return an array-like of all matching elements.
conversely to getElement(s) family functions, you're not limited to apply it on 'document' object, but you can also apply it to any html element: then the search is done in all element hierarchy ;)