function $(){ var elements = []; for(var i = 0, len = arguments.length; i < len; i++){ var element = els[i]; if(typeof element === 'string'){ element = document.getElementById(element); } elements.push(element); } return elements; }
function_$(els){ this.element = []; for(var i = 0, len = els.length; i < len; i++){ var element = els[i]; if(typeof element === 'string'){ element = document.getElementById(element); } this.element.push(element); } returnthis; }
_$.prototype = { each: function(fn){ for(var i = 0, len = this.element.length; i < len; i++){ fn.call(this, this.element[i]); } returnthis; },