Reference · Tile and table elements
languageOffunction
The language an element speaks: its own lang, or the nearest one above it, or the page's; Japanese for anything that starts ja.
Import it
import { languageOf } from "@johnmorrisdotca/jarajara/element";
Definition
function languageOf(element: Element): TileLanguage
Parameters
| Name | Type | Description |
|---|---|---|
element | Element | The DOM element whose language is read. |
Returns
TileLanguage
The language an element speaks: its own lang, or the nearest one above it, or the page's; Japanese for anything that starts ja.
Examples
import { languageOf } from "@johnmorrisdotca/jarajara/element";
const tile = document.createElement("div");
tile.lang = "ja";
console.log(languageOf(tile));