Lightweight, portable DOM manipulation utilities
npm install @andrewfeasel/jdomnpm install @andrewfeasel/jdom
import $J from "./jDOM.js";
$J.parse(data: string, mimeType: string): Document
Parses the serialized data, and returns a Document.
Valid types are "text/html" and "text/xml".
$J.create(htmlText: string): HTMLElement
Creates an HTML element from the text.
$J.ready(eventCallback: function): void
Executes the callback when the "DOMContentLoaded" event fires.
$J.id(elementId: string): Element | null
jDOM shorthand for document.getElementByid()
$J.one(selector: string, base?: Element): Element | null
Identical to document.querySelector, but you can optionally specify which object
you call querySelector on: defaults to document.
$J.all(selector: string, base?: Element): Array
document.querySelectorAll(), but with an optional base, and returns an Array of elements.
Make a pull request, and I will happily review it. I am always open for pull requests,
because I value your ideas and contributions, and I value the open-source community.
MIT license applies here.