Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

173
Views
Hide/Show video when button is pressed?

I'm trying to make a BMI Calculator, and to play a video that correlates with the entered BMI. I can't figure out how to do it though. I want the video to only appear when the calculate button is pressed. My script to show the results so far. `<!-- SCRIPT -->

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 ;
    }
}

` I don't know where to start, I'm a beginner to this. Sorry if I haven't clarified well enough.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can set the display of the element to none and change it when the button is pressed.

document.getElementById(/*id of the element */).style.display="none";
document.getElementById(/*id of the element */).style.display="/*display*/";
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!