竞彩足球即时比分,让你不错过任何精彩瞬间。
主队 | 比分 | 客队 |
---|
主队 | 比赛时间 | 分数据while (tbody.firstChild) {tbody.removeChild(tbody.firstChild);}// 添加最新比分数据scores.forEach(score => {const row = document.createElement('tr');const homeTeam = document.createElement('td');const scoreElement = document.createElement('td');const awayTeam = document.createElement('td');homeTeam.textContent = score.homeTeam;scoreElement.textContent = `${score.homeGoals} - ${score.awayGoals}`;awayTeam.textContent = score.awayTeam;row.appendChild(homeTeam);row.appendChild(scoreElement);row.appendChild(awayTeam);tbody.appendChild(row);}); }function updateFixtures(fixtures) {const tbody = fixtures.getElementsByTagName('tbody')[0];// 清空原有比赛数据while (tbody.firstChild) {tbody.removeChild(tbody.firstChild);}// 添加最新比赛数据fixtures.forEach(fixture => {const row = document.createElement('tr');const homeTeam = document.createElement('td');const time = document.createElement('td');const awayTeam = document.createElement('td');homeTeam.textContent = fixture.homeTeam;time.textContent = fixture.time;awayTeam.textContent = fixture.awayTeam;row.appendChild(homeTeam);row.appendChild(time);row.appendChild(awayTeam);tbody.appendChild(row);}); } |
---|