Your maximum heart rate (MHR) is the highest number of times your heart can beat per minute during maximal physical exertion. It's a crucial metric for cyclists to understand their training zones. A common and widely used formula to estimate MHR is the Tanaka formula, which is considered more accurate than the older "220 minus age" method for a broader range of individuals.
function calculateMaxHeartRate() {
var ageInput = document.getElementById("age");
var resultDiv = document.getElementById("result");
var age = parseFloat(ageInput.value);
if (isNaN(age) || age = 120) {
resultDiv.innerHTML = "Please enter a valid age between 1 and 120.";
return;
}
// Tanaka formula: MHR = 208 – (0.7 * Age)
var maxHeartRate = 208 – (0.7 * age);
resultDiv.innerHTML = "