cachaito
11/22/2014 - 8:36 PM

Check element attributes

.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}