I'm new to javascript , I'm trying learning how functions etc in JS and trying to add 2 numbers
If I remove the parseInt() the value is treated as a string only , then what is the point of using <input type="number">
?please explain to me.
what field to use for getting input as a number?
It's normal you get a string.
The purpose of the number type is that mobile browsers use this for showing the right keyboards and some browsers use this for validation purposes. For example the email
type will show a keyboard with the @ and '.' on the keyboard and number
will show a numeric keyboard.