UNPKG

jessquery

Version:

Modern JavaScript is pretty good, but typing document.querySelector() is a pain. This is a tiny library that makes DOM manipulation easy. jQuery is around 80kb (30kb gzipped), while this is only around 8kb (3.5kb gzipped). Lots of JSDoc comments so it's s

29 lines (27 loc) 693 B
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Document</title> </head> <body> <div id="test"></div> <button id="btn">Click Me</button> <button id="btn">Click Me</button> <script type="module"> import { $, $$ } from "../index.js" let count = 0 const test = $("#test") const btns = $$("#btn") btns .on("click", () => { count++ test.html(count) }) .wait(2000) .html("<span>hi</span>", true) .css("color", "red") </script> </body> </html>