あなたが私を助けてくれるなら、私は感謝します。
vitor = {
name:"Vitor",
age: 'yourage',
email:"seuemail@teste.com",
address:"my address",
};
function listContact(person){
//get a div that I need to show the data//
var contentInfo = document.getElementsByClassName('right-content')[0];
contentInfo.style.display = "block";
//search throught the object//
for(key in person){
contentInfo.innerHTML = person[key];
console.log(person[key]);
}
}
console.log と document.write を使用すると完全に表示されますが、オブジェクトを内部 HTML に割り当てると、オブジェクトの最後のキーのみが表示されます。私はどこで間違っていますか?