Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Body Mass Index calculator

P
Lo-Deck 2,460

@Lo-Deck

Desktop design screenshot for the Body Mass Index calculator coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


What are you most proud of, and what would you do differently next time?

Hi here is my solution for Body-Mass-Index-Calculator. I used HTML, CSS, JS.

What challenges did you encounter, and how did you overcome them?

It was to change the form and display different input as you choose between metric and imperial units.

And it was to do some calculation with imperial unit.

What specific areas of your project would you like help with?

I created and set an element and wanted to check whether the element existe or not. So my first thought was if(displayForm.nextElementSibling === span) used different way ('span', ...). It was not working, finally I used a variable to do exception.

It's possible or not to check it with .nextElementSibling?

if(sibling === 0)
{
        const createSpan = document.createElement('span');
        createSpan.innerText = 'Error not a valid input';
        displayForm.insertAdjacentElement("afterend", createSpan);
        sibling = 1;
 }

Feel free to leave any comments or advise.

Thanks.

Community feedback

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord