I\'m new to javascript , I\'m trying learning how functions etc in JS and trying to add 2 numbers
HTML Input elements are documented to return string representing a number. See the documentation here : Documentation of HTML Input
When you set input type="number" then these input field don't accept non numeric input but at the same time it doesn't make the input value type "number". The reason is inputted number contain digits as a subset of the valid characters, but they also contain completely non-numeric characters like spaces, hyphens and parenthesis.