JavaScript DOM( Selecting Elements)

What is the major difference between getElementsByClassName && querySelectorAll or querySelector ?when they are used along side each other in code?
How we get to know that which one should use while selecting class? Any brief explanation please ,Thank you .

querySelectorAll () retrieves a list of elements from the document based on your given selector, and returns a static NodeList object. getElementsByClassName () retrieves a list of elements from the document based on an element’s class name, and returns a live HTML collection of elements From Google

1 Like

NodeList object & live HTML collection of elements ,
In which cases NodeList object & live HTML collection should return in DOM manipulation ? Any ideas