Good all the time of the day gentlemen, the second time today

// ищем элемент по id document.getElementById('ididid').className += 'super_css_class'; 

Question: how to find not by id, but by reference value and change the class to it? Not even by class, but by value. Suppose there are 100 links on the site, one of them has href = 'http: //ya.ru'.

 //пробовал так, но это не то document.location.href('http://ya.ru').className += 'super_css_class'; 
  • one
    right here it works document.querySelectorAll ('a [href = "/ users / 11304 / eicto"]') - zb '

1 answer 1

querySelectorAll

 document.querySelectorAll('a[href="/users/11304/eicto"]') 

in ie, it works fine starting from ie9, but there is a polyfill and not one, pick the one that suits you.