let ar = [ { label: '显示文本1', value: 1 }, { label: '显示文本2', value: 2 }, { label: '显示文本3', value: 3 }, { label: '显示文本4', value: 4 }, { label: '显示文本5', value: 5 },] , html = '', tpl = '<p>{value}:{label}</p>', dom = document.querySelector("html"); for (let i = 0, len = ar.length; i < len; i++) { let a = ar[i]; html += tpl .replace(/{value}/g, a.value) .replace(/{label}/g, a.label) } dom.innerHTML = html;