足球比分直播间:实时追踪赛况,为您带来足球盛宴

来源:24直播网
实时追踪赛况

实时追踪赛况,为您带来足球盛宴

比赛 时间 比分 状态
中国 vs 日本 2023年3月20日 19:30 0 - 0 进行中
巴西 vs 阿根廷 2023年3月21日 02:30 1 - 2 已结束
西班牙 vs 葡萄牙 2023年3月22日 23:00 未开始
<script> // 模拟从数据库获取比赛数据并更新表格function updateTable() { // 获取比赛数据const matches = [{team1: "中国",team2: "日本",date: "2023-03-20",time: "19:30",score: "0 - 0",status: "live"},{team1: "巴西",team2: "阿根廷",date: "2023-03-21",time: "02:30",score: "1 - 2",status: "finished"},{team1: "西班牙",team2: "葡萄牙",date: "2023-03-22",time: "23:00",score: "-",status: "not-started"}];// 清空表格const tableBody = document.querySelector("tbody");tableBody.innerHTML = "";// 添加比赛数据到表格for (const match of matches) {const row = document.createElement("tr");const team1Cell = document.createElement("td");team1Cell.textContent = match.team1;row.appendChild(team1Cell);const team2Cell = document.createElement("td");team2Cell.textContent = match.team2;row.appendChild(team2Cell);const dateCell = document.createElement("td");dateCell.textContent = `${match.date} ${match.time}`;row.appendChild(dateCell);const scoreCell = document.createElement("td");scoreCell.textContent = match.score;row.appendChild(scoreCell);const statusCell = document.createElement("td");statusCell.textContent = match.status;statusCell.classList.add(match.status);row.appendChild(statusCell);tableBody.appendChild(row);}}// 每 10 秒更新一次表格setInterval(updateTable, 10000); </script>