dom element get attribute

JavaScript
document.getElementById('id1').getAttribute('attribute');
Source

Also in JavaScript: