js change html lang 1

js change html lang

document.documentElement.lang = lang;

Here is what the above code is Doing:
1. It’s creating a new script element.
2. It’s setting the script’s type to “text/javascript”.
3. It’s setting the script’s language to “javascript”.
4. It’s setting the script’s text to the code that will change the language.
5. It’s adding the script to the document.
6. It’s executing the script.

Similar Posts