輸入成績

body { font-family: Arial, sans-serif; display: flex; align-items: center; justify-content: center; height: 100vh; margin: 0; } .container { text-align: center; } input { padding: 8px; } button { padding: 8px 16px; cursor: pointer; } function submitScore() { // 取得成績輸入框的值 var score = document.getElementById('score').value; // 取得當前時間 var currentTime = new Date(); var hours = currentTime.getHours(); var minutes = currentTime.getMinutes(); var seconds = currentTime.getSeconds(); // 格式化時間 var formattedTime = hours + ':' + minutes + ':' + seconds; // 顯示成績和時間 var result = '成績:' + score + ',時間:' + formattedTime; document.getElementById('result').innerText = result; }