```html
Football Match Analysis Football Match Analysis
```
```javascript
const form = document.querySelector('form');
form.addEventListener('submit', (event) => {
event.preventDefault();
const team1 = document.querySelector('#team1').value;
const team2 = document.querySelector('#team2').value;
const score1 = parseInt(document.querySelector('#score1').value);
const score2 = parseInt(document.querySelector('#score2').value);
const result = analyzeMatch(team1, team2, score1, score2);
const resultsElement = document.querySelector('#results');
resultsElement.innerHTML = result;
});
function analyzeMatch(team1, team2, score1, score2) {
let result = `
Match Analysis
`;
if (score1 > score2) {
result += `
${team1} wins!
`;
} else if (score1 < score2) {
result += `
${team2} wins!
`;
} else {
result += `
It's a draw!
`;
}
result += `
`;
result += `- Team 1: ${team1}, Score: ${score1}
`;
result += `- Team 2: ${team2}, Score: ${score2}
`;
result += `
`;
return result;
}
```