In the code below, I am trying to call valueAsNumber but I just get a NaN returned. When I use parseInt I get the result I expect. Why Is this?
valueAsNumber
parseInt
You have to set the type of your input to number:
type
input
number
Also, if the value is empty or non-numeric, it'll return NaN.
NaN