Skip to content
0

katanakit-js / useGetRoot

Function: useGetRoot() ​

ts
function useGetRoot(): HTMLElement | null;

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

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

Returns ​

HTMLElement | null

The document.documentElement element.

Example ​

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

Released under the MIT License.