Open 662saurav opened 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"; }
});
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;
});