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