bikelooki.blogg.se

Realistic bmi calculator
Realistic bmi calculator












In order to do that, we first calculate total height in inches, by multiplying feet portion by 12 and adding the result to the inches portion. We start with BMICalculate function, which grabs our input variables entered on the form (weight in pounds, height in feet, and height in inches), and performs actual BMI calculation. Java Script is the “brain” of this application. Var DESC = document.getElementById('DESC') ĭocument.getElementById('weight').value = "" ĭocument.getElementById('heightft').value = "" ĭocument.getElementById('heightin').value = "3" ĭocument.getElementById('BMI').value = "" ĭocument.getElementById('DESC').value = "" If (thisBMI=18.5 & thisBMI=25 & thisBMI=30 & thisBMI=40)ĭescription ="Morbidly Obese - take action!" Įlse Description ="Please check your input values, BMI cannot be calculated." *Formatting font sizes, colors and line spacing*/ In the meantime, let’s walk through some specific code areas to get a better understanding of how this calculator actually works:īMI Calculator - Stay Healthy, learn your BMI score. My hope is that you will take the code provided, play with it, and make it your own. More so, if we have a foundation to build from. I am a strong believer in learning by doing. Not only it incorporates more enjoyable design, it is also equipped with error handling logic. Looking at my final product and comparing it to top 10 Google search results for BMI Calculator makes it all worthwhile….

realistic bmi calculator realistic bmi calculator

However, tweaking my code and making it work, was a very time-consuming process. Surely, “World’s Largest Web Development Site” provides more than enough reference material for all elements required: HTML and JavaScript, as well as optional, but handy styling language – CSS. You can see the working calculator above of this post, but I would be lying saying that its creation was painless. How difficult would it be to rewrite that calculator in JavaScript to embed it on any webpage for people to use? Not that difficult, thought I, remembering happy days of browsing the original, NOT corporate owned, HTML Goodies website in search of the coolest JS mouse-over effects, some 15 years ago.

realistic bmi calculator

We already created a BMI (Body Mass Index) Calculator using Excel VBA last month. Coding your first JavaScript application – BMI Calculator.Įrror: BMI Calculator could not be displayed, please upgrade your browser.














Realistic bmi calculator