change html language javascript code example Example: js change html lang document.documentElement.lang = lang;