3 ms·function $ (s) { return document.querySelectorAll(s); } Would be more jquery like.by rpastuszak 3y agofunction $ (s) { return document.querySelectorAll(s); } Would be more jquery like.nojs 3y agoYou’re right, $('#id') would fail with Paul’s version, haha.nailer 3y agoYou can also: if ( ! Nodelist.prototype.map ) { Nodelist.prototype.map = Array.prototype.map } So map() works. forEach() already does.