.hasAttribute(attr name) od IE9 + .attributtes id IE6
//<div id="someID" class="someClass">...</div> var elem = document.getElementById('someID'); elem.hasAttribute('class'); //true elem.attributes; // object {0: id, 1: class, length: 1}