CodeNewbie Community 🌱

Discussion on: What do querySelectorAll and getElementsBy methods return?

Collapse
 
chukwukagideon profile image
Chukwukagideon

Well to the best of my knowledge, querySelectorAll returns all selectors that is being targeted (e.g query selector all(".hello") selects all elements with the class "hello".
haven't really come across getElementsBy methods before, but I guess its basically targeting all elements with a particular method. But if you meant getElementById - The document.getElementById() method returns the element of specified id.