Estoy tratando de hacer una calculadora de IMC y reproducir un video que se correlaciona con el IMC ingresado. Sin embargo, no puedo entender cómo hacerlo. Quiero que el video solo aparezca cuando se presiona el botón Calcular. Mi script para mostrar los resultados hasta ahora. `<!-- GUIÓN -->
function BMI() { var h=document.getElementById('h').value; var w=document.getElementById('w').value; var bmi=w/(h/100*h/100); var bmio=(bmi.toFixed(2)); if (bmio < 18.5) { document.getElementById("result").innerHTML="You're Underweight, Your BMI is " + bmio; } if (bmio > 18.4 && bmio < 25 ) { document.getElementById("result").innerHTML="You're Healthy, Your BMI is " + bmio ; } if (bmio > 24.9 && bmio < 30 ) { document.getElementById("result").innerHTML="You're Overweight, Your BMI is " + bmio ; } if (bmio > 30 ) { document.getElementById("result").innerHTML="You're Obese, Your BMI is " + bmio ; } }` No sé por dónde empezar, soy un principiante en esto. Lo siento si no he aclarado lo suficientemente bien.
Puede establecer la visualización del elemento en ninguno y cambiarlo cuando se presiona el botón.
document.getElementById(/*id of the element */).style.display="none"; document.getElementById(/*id of the element */).style.display="/*display*/";