select html element with attribute in javascript code example Example: javascript select element with attribute document.querySelectorAll('[attrname="value"]');