11 lines
206 B
TypeScript
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;
|
|
}
|