Skip to content

UseGetRoot

katanakit-js / useGetRoot

function useGetRoot(): HTMLElement | null;

Defined in: infrastructure/dom/dom.service.ts:41

Returns the root <html> element, or null outside a browser.

HTMLElement | null

The document.documentElement element.

const root = useGetRoot();
root?.setAttribute("lang", "en");