Skip to content

Back to Snippets

lang()

Returns the DOM element’s language.

const lang = el => el.closest('[lang]')?.lang;