Skip to content

Instantly share code, notes, and snippets.

@elclanrs
Last active December 15, 2015 23:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save elclanrs/5341331 to your computer and use it in GitHub Desktop.
Save elclanrs/5341331 to your computer and use it in GitHub Desktop.
var jQuery = (function jQueryClass(win, doc) {
var AP = Array.prototype;
function jQuery(selector) {
this.el = this._init(selector);
this.length = this.el.length;
}
function $(selector) {
return new jQuery(selector);
}
jQuery.prototype = {
_init: function(selector) {
return AP.slice.call(doc.querySelectorAll(selector));
}
};
return win.$ = $;
}(window, document));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment