占位符不改变形式的价值

我有一个表格。此表单具有带有占位符的输入字段。这些占位符应根据变量(languageFirstTwo)的值来调整其值。

我感到困惑,因为输入字段中的一个占位符更改值,而另一个占位符不更改(名字更改,电子邮件不更改)。

任何帮助将不胜感激。谢谢。

JS

var language = navigator.languages[0] || navigator.language;
languageFirstTwo = language.substr(0,2); //doesn't have var/let/const for a reason

lngs = document.getElementsByClassName("lng");


let fname = document.getElementById("fname");   
let email = document.getElementById("email");   

placeholders = {
    sl: { fname: "Janez", email: "moj@email.si" },
    en: { fname: "John", email: "my@email.us" }, 
    de: { fname: "Kommissar", email: "mein@email.deu" },
    it: { fname: "Fabio", email: "barilla@email.it"},
    hr: { fname: "Mirko", email: "moj@email.hr"},
    ru: { fname: "Mikayl", email: "moji@email.ru"}
}; 

init2(languageFirstTwo);

function init2(languageFirstTwo) {
    if (Object.keys(placeholders).includes(languageFirstTwo)){
        const values = placeholders[languageFirstTwo];
            fname.setAttribute("placeholder", values.fname); //changes
            email.setAttribute("placeholder", values.email); //does not change
    }
}

的HTML

<form>
    <input type="text" pattern="[A-Za-z][^0-9]{2,25}" name="fname" id="fname" placeholder="John" autofocus="autofocus" autocorrect="off" autocapitalize="off"/>
    <input type="email" name="email" id="email" autocorrect="off" autocapitalize="off" maxlength="45" placeholder="my@email.com"/>
</form>