Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8209325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:41:12+00:00 2026-06-07T09:41:12+00:00

After click, a calculated BMI is shown as 0.3; expected answer was 22.8 Code

  • 0

After click, a calculated BMI is shown as 0.3; expected answer was 22.8

Code snippet in question:

calculateButton.addEventListener('click', function() {
    var feet = feetField.value;
    var inches = inchesField.value;
    var heightInInches = (feet * 12) + inches;
    bmiDisplay.text = ((weightField.value / (heightInInches * heightInInches)) * 703).toFixed(1);
});

heightInInches should equal 68, not 608. Seems like somehow feet (5) is being multiplied by 120 instead of 12 and then tacking on the inches (8) at the end, but I don’t quite understand why that’s happening, and why it’s hiding from me when I step through the code?

Debugger shows the correct values for feet(5) and inches(8) in the formula but an incorrect value assigned to heightInInches after the calculation.

Link to BMI formula

I think I formatted the question correctly; long time listener, first time caller. I’ve just been staring at it too long… I had screenshots of my UI and the debugger but I had to remove those images from the post. Ok, thanks for checking it out.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T09:41:13+00:00Added an answer on June 7, 2026 at 9:41 am

    Try by adding:

    var feet = parseFloat(feetField.value);
    var inches = parseFloat(inchesField.value);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After I click update in the grid view, the code works successfully. But when
I have used onclick function. after click a button show data. but intially data
My function Event.observe(n,click,respondClick) execute respondClick ON click. But I need to execute respondclick AFTER
In following code $('body').delegate('.submit',... passed = search && passed; ... after click on button
I'm creating a Tic tac toe game, in that after click made by user
I'm using jQuery BlockUI Plugin and I'd like to do Javascript:history back(); after Click
I want create an application with animate button? how can i do? after click
I am updating multiple records and after I click submit button I get the
I want to call setTimeout() after a click occurs. If the user clicks again
Why do my buttons (array of buttons) disappear after I click any of them?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.