how to find all elements with attribute in html code example Example: how to get element by attribute value in javascript document.querySelectorAll('[data-foo="value"]');