var elements = document.querySelectorAll('[author_id]'); var identifiers = Array.prototype.map.call(elements, function(element) { return element.getAttribute('author_id'); }); alert(identifiers);