I would use document.getElementsByClassName but IE does not support it.
You can't really replicate getElementsByClassName, because it returns a nodeList, and so its value is live, and updates with the document.
You can return a static Array of elements who share the same classnames- but it won't 'know'when the document changes.
(It won't take too many of these kind of things to make a library look svelte...)
function getArrayByClassNames(classes, pa){
if(!pa) pa= document;
var C= [], G;
if(pa.getElementsByClassName){
G= pa.getElementsByClassName(classes);
for(var i= 0, L= G.length; i
//Example
var A= getArrayByClassNames('sideBar local')