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

44 lines (42 loc) 1.21 kB
<!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 class="container"> <h1>jQuery is for old people.</h1> <div class="card"> <button id="counter" type="button"></button> <button id="counter" type="button"></button> <button>I AM NOT THAT BUTTON</button> </div> <script type="module"> import { $, $$ } from "../index.js" let count = 0 const counter = $$("#counter").text(count) counter .text(count) .on("click", () => { count++ counter.text(count) }) .css("border", "2px solid black") .css({ padding: "10px", borderRadius: "5px", cursor: "pointer", }) .parent() .css("border", "2px solid red") .parent() .css("border", "2px solid blue") .refresh() .css("backgroundColor", "lightgreen") // .pick("#counter") // .css("backgroundColor", "lightgreen") </script> </body> </html>