html js document.getElementById 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 all elements with "someAttr" attribute
document.querySelectorAll('[someAttr]')