I'm facing an issue with my if statement not functioning correctly when trying to validate non-numeric inputs for the weight variable upon submission. What could be causing this problem?
submitBtn.onclick = function(){
var name = document.getElementById('name').value;
var weight = document.getElementById('weight').value;
var pound = weight * 2.20462;
//Check that the value is a number
if(isNan(weight)){
alert("Please enter a number);
}
}
You can view the code in action on this JsFiddle link