I\'m new to javascript , I\'m trying learning how functions etc in JS and trying to add 2 numbers
Neither HTML nor HTTP really have the concept of data types (possibly because they aren't programming languages to begin with) and everything is a string. When you use another language to reach that information you may sometimes get some amount of magic as a feature (for instance, PHP will generate arrays from GET/POST fields that have paired square brackets on their names) but that's a feature of such other language.
In this case, .value belongs to the DOM API and such API does have types. But let's see how it's defined. The tag is represented by the HTMLInputElement interface and the value property is of type DOMString:
DOMString is a UTF-16 String. As JavaScript already uses such strings, DOMString is mapped directly to a String.
In other words, type="number" is a hint to implement client-side validation and appropriate GUI controls but the underlying element will still store strings.
