<script>
const form = document.querySelector("form");const results = document.querySelector(".results");const resultsTable = document.querySelector("results-table tbody");form.addEventListener("submit", (e) => {e.preventDefault();const homeTeam = document.querySelector("home-team").value;const awayTeam = document.querySelector("away-team").value;const homeGoals = parseInt(document.querySelector("home-goals").value);const awayGoals = parseInt(document.querySelector("away-goals").value);// 计算预测比分const predictedHomeGoals = Math.floor(Math.random() (homeGoals + 1));const predictedAwayGoals = Math.floor(Math.random() (awayGoals + 1));// 更新结果表const newRow = document.createElement("tr");const homeTeamCell = document.createElement("td");const awayTeamCell = document.createElement("td");const predictedScoreCell = document.createElement("td");homeTeamCell.textContent = homeTeam;awayTeamCell.textContent = awayTeam;predictedScoreCell.textContent = `${predictedHomeGoals} - ${predictedAwayGoals}`;newRow.appendChild(homeTeamCell);newRow.appendChild(awayTeamCell);newRow.appendChild(predictedScoreCell);resultsTable.appendChild(newRow);// 显示结果results.style.display = "block";});
</script>
相关阅读: 实时掌控球赛动态 实时竞彩足球比分预测 领先优势