+ 1
What am I doing wrong / any suggestions
4 Réponses
+ 3
Your javascript is incorrect.
Add the
onclick="getBmi()"
Attribute to the submit button in the html.
Change your JS to;
function bmi(height,weight) {
return (weight / (weight * weight))*703;
}
function getBmi() {
let weight = document.getElementById("weight").value;
let height = document.getElementById("height").value;
let bmiResult = bmi(height, weight);
document.getElementById("bmi-result").value = bmiResult;
}
That should get it working for the most part.
+ 1
Thank you
0
the mathematics are correct
0
ChaoticDawg look at this updated version and let me know what you think
https://code.sololearn.com/WUa2NwSRC36G/