how to access an attribute of an HTML element from javascript code example
Example: get element attribute javascript
var x = document.getElementsByTagName("H1")[0].getAttribute("class");
var x = document.getElementsByTagName("H1")[0].getAttribute("class");