downthemall/windows/winutil.ts
2019-08-25 22:30:07 +02:00

11 lines
206 B
TypeScript

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