get item by html attribute code example
Example 1: dom element get attribute
document.getElementById('id1').getAttribute('attribute');
Example 2: js get element by attribute
//find all elements with "someAttr" attribute
document.querySelectorAll('[someAttr]')