get attribue js code example
Example 1: js get element by attribute
//find first element with "someAttr" attribute
document.querySelector('[someAttr]')
Example 2: js get element by attribute
//find all elements with "someAttr" attribute
document.querySelectorAll('[someAttr]')