var a = document.getElementsByTagName('a'), elements = [], i = 0, len = a.length, classList = document.documentElement.classList, className = 'some-class'
for(; i < len; i++){
if(classList){
a[i].classList.contains(className) && elements.push(a);
}else {
(a[i].className.split(' ').indexOf(className)+1) && elements.push(a);
}
}
Где то так.