QuerySelectorAll is widely supported and you can make your own shorthand for it.
function $(query) {
const result = document.querySelectorAll(query)
if ( result ) {
if ( result.length > 1 ) {
return result
} else {
return result[0]
}
}
}
I hope you don't use that since it randomly returns either an element or a list of elements, so you'd have to also add an if/else every time you use it.