downthemall/windows/winutil.ts
2020-08-29 20:54:26 +02:00

11 lines
217 B
TypeScript

"use strict";
// License: MIT
export function $<T extends HTMLElement>(
q: string, el?: HTMLElement | DocumentFragment | Document): T {
if (!el) {
el = document;
}
return el.querySelector<T>(q) as T;
}