javascript get attribute by name code example
Example 1: dom element get attribute
document.getElementById('id1').getAttribute('attribute');
Example 2: js get element by attribute
//find first element with "someAttr" attribute
document.querySelector('[someAttr]')