So this is my coding, I really hope you guys can help me. I'm trying to put the result of the calculation in the textarea but I just don't know how and what should I use.
I have been trying to use span ID and getElementById. I think the language that I used is the most basic language.
<html>
<head>
<script type="text/javascript">
function bmicalc ()
{
var fheight = document.form1.fheight.value;
var fweight = document.form1.fweight.value;
var result;
result = fweight / ( fheight * fheight);
return result;
}
</script>
</head>
<body>
<p align="center"><b><font size="4">BMI CALCULATOR</font><b></p>
<form name="form1" method="post" action="">
<table border="0" align="center">
<tr>
<td>Height:</td>
<td><input name="fheight" type="text" size="15"> meters
</tr>
<tr>
<td>Weight:</td>
<td><input name="fweight" type="text" size="15"> kilograms
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" name="submit" value="Get result" onclick="bmicalc()">
<input type="reset" name="reset" value="Reset">
</td>
</tr>
<tr>
<td colspan="2" align="center">
<textarea name="result" cols="30" rows="5" >
Your BMI is <result>
</textarea>
</tr>
</body>
</html>