输入表格-步骤

当我在输入表单中添加“ step”时,我的JS代码无法正常工作。我需要浮点数,所以它是.01这是我的代码。

        <div class="input">
            <label for="height">Height</label>
            <input type="number" name="height" placeholder="0.00 cm" id="height" step=".01">
        </div>

函数calculateBMI(){

const inputHeight = (document.getElementById("height").value);
const inputWeight = (document.getElementById("weight").value);
const bmi = inputWeight / Math.pow(inputHeight, 2).toFixed(2);

document.getElementById("result").innerHTML = 'Your BMI is ' + bmi;
document.getElementById("result").style.display = "block";

if (inputHeight === "" && inputWeight === "") {
    alert("Invalid input");
}

}