java script how to get element based on attribute value 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");