0
<script>
function calcular() {
var p = parseFloat(document.getElementById('peso').value);
var e = parseFloat(document.getElementById('estatura').value);
document.getElementById('imc').value = p / ((e * e) / 10000);
}
</script>
<input type="text" class="form-control" id="imc" name="imc" onblur="calcular()">
Thanks for the return Laércio, but it is not working, the number keeps appearing with several decimal places after the point.
– Ramiro
worked when removing the dot and comma ";" . Any tips for learning javascript on the internet?
– Ramiro
There are many courses at Udemy at affordable prices with good recommendations and many students, this one is free: https://www.youtube.com/playlist?list=PLHz_AreHm4dlsK3Nr9GVvXCbpQyHQl1o1
– Laércio Lopes