getElementById trả về element đầu tiên có id, nhanh nhất. querySelector trả về element đầu tiên khớp CSS selector. querySelectorAll trả về NodeList tất cả elements khớp (static, không live). getElementsByClassName và getElementsByTagName trả về HTMLCollection (live). querySelectorAll phổ biến nhất vì linh hoạt.
getElementById returns the first element with the given id and is the fastest. querySelector returns the first element matching a CSS selector. querySelectorAll returns a NodeList of all matching elements (static, not live). getElementsByClassName and getElementsByTagName return a live HTMLCollection. querySelectorAll is most commonly used for its flexibility.