# Javascript Please Help

**URL:** <https://forum.freecodecamp.org/t/javascript-please-help/497019>\
**Category:** Curriculum Help\
**Tags:** javascript\
**Created:** [February 14, 2022, 4:09pm UTC](https://forum.freecodecamp.org/t/javascript-please-help/497019 "2022-02-14T16:09:34Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![arbinashemael](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/arbinashemael/32/217876_2.png) [@arbinashemael](https://forum.freecodecamp.org/u/arbinashemael)\
**Post date:** [February 14, 2022, 4:09pm UTC](https://forum.freecodecamp.org/t/javascript-please-help/497019/1 "2022-02-14T16:09:34Z")

</div>

![image](https://global.discourse-cdn.com/freecodecamp/original/3X/8/9/89a66f00ef470bdda6d89efac2a3f486b4791a8b.png)  
 ![image](https://global.discourse-cdn.com/freecodecamp/original/3X/1/c/1c5b032eb0b1e2f7e3ad4eaeab0745ee76defc09.png)

My submit button is not executing anyone know wy

---

<div class="post-metadata">

**Author:** ![JeremyLT](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jeremylt/32/291894_2.png) [@JeremyLT](https://forum.freecodecamp.org/u/JeremyLT)\
**Post date:** [February 14, 2022, 4:15pm UTC](https://forum.freecodecamp.org/t/javascript-please-help/497019/2 "2022-02-14T16:15:28Z")

</div>

Please post your actual code instead of a picture. Thanks!

---

<div class="post-metadata">

**Author:** ![ArielLeslie](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/arielleslie/32/264841_2.png) [@ArielLeslie](https://forum.freecodecamp.org/u/ArielLeslie)\
**Post date:** [February 14, 2022, 4:17pm UTC](https://forum.freecodecamp.org/t/javascript-please-help/497019/3 "2022-02-14T16:17:56Z")

</div>

Can you please also give us more information? What do you mean by “not executing”? What happens when the button is pushed? What do you expect to happen? Do you get any error messages? What debugging steps have you already tried?

---

<div class="post-metadata">

**Author:** ![arbinashemael](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/arbinashemael/32/217876_2.png) [@arbinashemael](https://forum.freecodecamp.org/u/arbinashemael)\
**Post date:** [February 14, 2022, 4:18pm UTC](https://forum.freecodecamp.org/t/javascript-please-help/497019/4 "2022-02-14T16:18:50Z")

</div>

```auto
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
    <link rel="stylesheet" href="assigment.css" />
</head>
<body>
    <h1 style="text-align:center;">Basal Metabolic rate Calculator</h1>
    <fieldset>
    <div>
        <ul>
            <li style="display:inline;"><a href=#>Metric</a></li>
            <li style="display:inline;"><a href=#>Imperical</a></li>
        </ul>
    </div>

        <div id="content">
            <h1 >BMR Metric</h1>
            <label for="sex">Sex:
            <select id="sex" name="sex">
                <option value="female" >Female</option>
                <option value="male">Male</option>
            </select></label><br />
            <label for="age">Age:
            <input type="number" id="age" name="age"/></label> <br />
            <label for=" height">Height:
            <input type="number" id="height"name="height" /></label> <br />
            <label for="Weight">Weight:
            <input type="number" id="weight"name="weight" />
            <br />

            <input type="submit" value="Calculate BMR" />
               <script src="assigment1.js"></script>
            </label>
            <script src="assigment1.js"></script>  
        </div>
     </fieldset>
 
</body>

</html>

```

**my javascript**

```auto
function calculateBMR() {
    var age = document.getElementById("age").value;
    var height = document.getElementById("height").value;
    var weight = document.getElementById("weight").value;
    var sex = document.getElementById("sex").value;
    var bmr;
    
    if (sex == "female") {
        bmr = 655 + (9.563 * weight) + (1.850 * height) - (4.676 * age);
       
    }
    else {
        bmr = 66.5 + (13.75 * weight) + (5.003 * height) - (6.755 * age);
        
    }
    document.write(bmr);

}

```

---

<div class="post-metadata">

**Author:** ![arbinashemael](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/arbinashemael/32/217876_2.png) [@arbinashemael](https://forum.freecodecamp.org/u/arbinashemael)\
**Post date:** [February 14, 2022, 4:19pm UTC](https://forum.freecodecamp.org/t/javascript-please-help/497019/5 "2022-02-14T16:19:54Z")

</div>

like when i push the submit button its suppose to calculate the BMR is not  
there is no action

---

<div class="post-metadata">

**Author:** ![JeremyLT](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jeremylt/32/291894_2.png) [@JeremyLT](https://forum.freecodecamp.org/u/JeremyLT)\
**Post date:** [February 14, 2022, 4:21pm UTC](https://forum.freecodecamp.org/t/javascript-please-help/497019/6 "2022-02-14T16:21:31Z")

</div>

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (`</>`) to add backticks around text.

 ![Pre-formatted-text](https://global.discourse-cdn.com/freecodecamp/original/3X/1/b/1b18854f1059217f29370444396145cc3a0cd8ae.gif)

See [this post](https://forum.freecodecamp.org/t/forum-code-formatting/25574) to find the backtick on your keyboard.  
**Note:** Backticks (`) are not single quotes (’).

---

<div class="post-metadata">

**Author:** ![ArielLeslie](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/arielleslie/32/264841_2.png) [@ArielLeslie](https://forum.freecodecamp.org/u/ArielLeslie)\
**Post date:** [February 14, 2022, 4:34pm UTC](https://forum.freecodecamp.org/t/javascript-please-help/497019/7 "2022-02-14T16:34:28Z")

</div>

I don’t see any code calling the `calculateBMR()` function.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [August 16, 2022, 4:34am UTC](https://forum.freecodecamp.org/t/javascript-please-help/497019/8 "2022-08-16T04:34:36Z")

</div>

Closed on August 16, 2022, 4:34am UTC

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
