Chapter 3 project 3-2 create a web page that you van use to calculate your targe
ID: 3647560 • Letter: C
Question
Chapter 3 project 3-2create a web page that you van use to calculate your target heart rate. Use a form that contains a text box in which users can enter their age, and a command button that uses an onclick event handler to call a function named calcHeartRate (). Within the calcHeartRate (), include a statement that calculate the maximum heart rate and assigns the result to a variable. Use two other statements that calculate minimum (50%)and maximum(85%) target heart rates. To calculate minimum target heart rate, maximum heart rate *.5 and to calculate To calculate maximum target heart rate, maximum heart rate *.85. After you calculate min and max target heart rate. display the result in another text box in the form.
This is the just of it, the part I can't seem to get is how to get the min and max targeted heart rate in the last text box to come up, in to box. I can get it with the window.write but not in the box. please help this is what I have:
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>Calculate Heart Rate</title>
<script type="text/javascript">
function calcHeartRate (result)
{
//window.alert ("It is Calculated");
var age=document.HeartRate.EnterAge.value;
var maxRate=220-age;
//window.alert (maxRate);
var targetMin=maxRate*.5;
var targetMax=maxRate*.85;
//window.alert (targetMin);
//window.alert (targetMax);
}
</script>
</head>
<body>
<form action=""name="HeartRate" method="post" >
Enter your age:<input name="EnterAge" size="20" type="text">
<br><br>
Please press calculate:<input name="CalculateHeart" type="button" value="Calculate">
<br>
<br>
<input name="minMax" type="text">
</form>
</body>
</html>