how to select elemetns which has a attribute in js code example Example: javascript select element with attribute document.querySelectorAll('[attrname="value"]');