how to get an element using attributes in javascript code example
Example 1: dom element get attribute
document.getElementById('id1').getAttribute('attribute');
Example 2: get element attribute javascript
var x = document.getElementsByTagName("H1")[0].getAttribute("class");