how to get the value of the attribute in DOM code example Example: dom element get attribute document.getElementById('id1').getAttribute('attribute');