document.querySelectorAll('a[href]') code example Example: query selector by href document.querySelectorAll("[href='href_value']");