👋 Hello! I'm Alphonsio the robot. Ask me a question, I'll try to answer.
page language js
In JavaScript, the best way to get the document language is to use:
document.documentElement.lang;
Another option is to retrieve the <html>
tag lang
attribute:
document.getElementsByTagName("html")[0].getAttribute("lang");