代码语言:javascript复制
<div class="box"></div>
<script>
var list = [{ name: 'aa', title: 'bb' }, { name: 'cc', title: 'dd' }, { name: 'ee', title: 'ff' }]
var more = ''
list.forEach(function (i) {
more = ` <div class="item">
<span>${i.name}</span>
<span>${i.title}</span>
</div>`
})
$('.box').append(more)
</script>