js query selector by data code example Example: javascript select element with attribute document.querySelectorAll('[attrname="value"]');