<script>
// 模拟比赛比分数据const matches = [{homeTeam: '曼联',awayTeam: '利物浦',score: '1-2'},{homeTeam: '皇马',awayTeam: '巴塞罗那',score: '2-1'},{homeTeam: '拜仁慕尼黑',awayTeam: '巴黎圣日耳曼',score: '3-0'},// ...];// 将比赛比分动态添加到页面中const main = document.querySelector('.main');matches.forEach(match => {const div = document.createElement('div');div.classList.add('match');const h2 = document.createElement('h2');h2.textContent = `${match.homeTeam} vs ${match.awayTeam}`;const p = document.createElement('p');p.textContent = `比分:${match.score}`;div.appendChild(h2);div.appendChild(p);main.appendChild(div);});
</script>
相关阅读: 不错过任何一场激动人心的比赛 足球比赛比分速递