13 lines
280 B
TypeScript
13 lines
280 B
TypeScript
export const qs = (
|
|
query: string,
|
|
el: Element | Document = document,
|
|
): HTMLElement | null => {
|
|
return el.querySelector(query);
|
|
};
|
|
|
|
export const qsa = (
|
|
query: string,
|
|
el: Element | Document = document,
|
|
): NodeListOf<HTMLElement> => {
|
|
return el.querySelectorAll(query);
|
|
};
|