// 1.利用文档碎片
let box = document.querySelector('#box'),
frag = document.createDocumentFragment();
for (let i = 0; i < 10; i++) {
let span = document.createElement('span');
span.innerHTML = i + 1;
frag.appendChild(span);
}
box.appendChild(frag);
// 2.利用字符串拼接
let box = document.querySelector('#box'),
str = ``;
for (let i = 0; i < 10; i++) {
str += `<span>${i+1}</span>`;
}
box.innerHTML = str;
08-19
08-19
09-14