'; html += ''; html += ''; html += ''; html += ''; html += ''; html += '
每公里油耗' + (oil/km*1000).toFixed(1) + ' mL/km
每公里成本¥ ' + perKm.toFixed(2) + ' 元/km
总油费¥ ' + cost.toFixed(2) + '
百公里油费¥ ' + (p100 * price).toFixed(2) + '
'; resultContent.innerHTML = html; resultMeta.textContent = p100.toFixed(2) + ' L/100km'; resultArea.classList.add('show'); }); document.getElementById('btn-clear').addEventListener('click', function() { form.reset(); clearError(); clearResult(); }); })();