0
let listValue = [
{
key: '1',
value: {
mark: 'Audi',
model: 'A1',
}
},
{
key: '2',
value: {
mark: 'Audi',
model: 'TT',
}
}
];
localStorage.setItem('listValue', JSON.stringify(listValue));
let carObj = JSON.parse(localStorage.getItem('1'));
document.getElementById("new2").innerHTML = carObj.mark;
您正在使用項目與關鍵「設置listValue '並通過鍵'1'獲取? – krrish