题解 | JS11 列表动态渲染
for(let i = 0;i<people.length;i++){
const li = document.createElement('li');
const spanName = document.createElement('span');
const spanAge = document.createElement('sapn');
spanName.innerText = people[i].name;
spanAge.innerText = " "+ people[i].age + "岁";
li.appendChild(spanName)
li.appendChild(spanAge)
ul.appendChild(li)
}