A minimal implementation of jQuery in TypeScript.
A learning exercise with a limited feature set, and support only for modern browsers. Tested only in Chrome (v92).
Implements:
$()
(element collection selector).ready()
$.each()
(operates over element collection in args):eq()
Selector.on()
.click()
.hover()
.append()
.html()
.css()
.attr()
.addClass()
.removeClass()
.width()
Uses code borrowed from a popular image slider written by André Cortellini to test the implementation.
Install TypeScript (npm i -g typescript
) and run tsc
to compile. Open ./demo/index.html
to check it works.