shradha-khapra / JavaScriptSeries

247 stars 210 forks source link

Issue related to .value #16

Open 662saurav opened 6 months ago

662saurav commented 6 months ago

Can somebody please help me in explaining why these lines of code not working

btn.addEventListener("click", (evt) => { evt.preventDefault();
let amt = document.getElementById("amount"); let amtVal = amt.value;

if(amtVal < 0 || isNaN(amtVal) || amtVal == "") {
    amtVal = "1";

}

});