Find all matching elements on a page. You can use any valid CSS selector.
// Get all elements with the .bg-red class
var elemsRed = document.querySelectorAll('.bg-red');
// Get all elements with the [data-snack] attribute
var elemsSnacks = document.querySelectorAll('[data-snack]');
Source
https://vanillajstoolkit.com/reference/selectors/document-queryselectorall/