Files
task-inventory/public/lib/dom.mjs
mikael-lovqvists-claude-agent 1100720b03 Initial project setup for task-inventory
Node.js + Express 5 backend with flat NDJSON key-value store (borrowed from
electronics-inventory). Sequential integer IDs per namespace. Vanilla JS SPA
with filters for status, priority, and tags.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 18:05:30 +00:00

17 lines
541 B
JavaScript

export function qs(scope, selector) {
if (typeof scope === 'string') { return document.querySelector(scope); }
return scope.querySelector(selector);
}
export function clone(template_id) {
return document.getElementById(template_id).content.cloneNode(true).firstElementChild;
}
export function set_text(el, selector, text) {
const target = typeof selector === 'string' ? el.querySelector(selector) : selector;
target.textContent = text;
}
export function show(el) { el.hidden = false; }
export function hide(el) { el.hidden = true; }