how to get the property value of an element in js code example Example: how to get element by attribute value in javascript document.querySelectorAll('[data-foo="value"]');