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

  • Home
  • SEARCH
  • 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 8166383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:50:43+00:00 2026-06-06T19:50:43+00:00

I am trying to make a BMI Calculator using HTML. The inputs come from

  • 0

I am trying to make a BMI Calculator using HTML. The inputs come from text fields. I am making some calculation with them in a Javascript function. I want to get the calculated values in a span like this:

<span id="" class="">Your Calculation Results is = </span>
<span id="" class="">   "" I want the result here ""    </span>

====================================================================
Edit : The part that i am asking about

<script language="javascript">
var bmi = document.getElementById("ID_bmiResult2").innerHTML;
bmi.value = weight / (heightInMeter * heightInMeter);
</script>

<body>
<span id="ID_bmiResult2">  </span>
</body>

i don’t know how to make it …

  • 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-06T19:50:47+00:00Added an answer on June 6, 2026 at 7:50 pm

    Edit: As it was pointed out, FF doesn’t like innerText, so I’m replacing to innerHTML which in this particular case doesn’t not change the overall functionality of the script.

    You can get the 2nd span and pass the value directly to innerHTML like this:

    document.getElementsByTagName('span')[1].innerHTML= 'the result';
    

    Note: Consider using and id or class so you can find the exact element you need to change instead of retrieving several elements of that type (in this case span).
    If you had an id, it would be like this:

    document.getElementById('the id goes here').innerHTML= 'the result';
    

    Edit2: This edit was made after the OP changed his question
    It got really confusing now that I’m seeing your code.
    I’ve written this fiddle so you can see it working

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying make some stuff in jQuery using ASP.NET. But the ID from runat=server
Am trying to make a HTML page that calculate the BMI for adults and
Trying to make the infamous checkall checkbox for dynamically created rows from a MySQL
im trying make one replace in string from a array but this dont work
I'm trying make a static text which if too long for the sizer, will
I'm trying make a simple control, with a some path in it. And binding
Trying to make td elements clickable. Here's my HTML: <td id=A3 class= open-square><a href=/gameplay/A3></a></td>
I'm trying make a <dl> to define the icons I am using on the
Trying to make a simple client that consumes a web service using RemObjects SDK,
Trying to make a Grid Like this using java and I'm assuming a 2d

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.