This is a solution to the Body Mass Index Calculator challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Note: Delete this note and update the table of contents based on what sections you keep.
Was a little challenging if getting used to JavaScript. BMI was a great warmup. Some css understanding of flexbox and grid. BMI using JS is operable. I chose *imperial instead of both.
Users should be able to:
./assets/images/screenshot.png
The JavaScript side of things. First time actually using conditionals:
if (bmi <= 18.4) { document.getElementById(‘message’).innerHTML = ‘You are under weight’ } else if (bmi >= 18.5 && bmi <= 24.9) { document.getElementById(‘message’).innerHTML = ‘You are at a healthy weight’ } else { document.getElementById(‘message’).innerHTML = ‘You are overweight’ }
To continue with JS with more challenges