class JQuery { constructor(selector) { const dom = document.querySelectorAll(selector); for (let i = 0; i < dom.length; i++) { this[i] = dom[i]; } this.length = dom.length; this.selector = selector; } each(fn) { for (let i = 0; i < this.length; i++) { fn(this[i], i); } } get(index) { return this[index]; } on(eventName, fn) { this.each(function (item) { ite
Gonwe
一念智即般若生。
CC BY-SA 4.0