Why is a the value of an input type number and a string not a number?

1

I am wrong or if I get javascript with the value of an input type number will it be a string and not a number?

    
asked by anonymous 12.08.2017 / 00:50

1 answer

1

HTML does not have data types. This question of forms having a type is for browsers to work better with information for each type of form.

For type number <input type="number" ...> , this is just for mobile phones, smartphones show the numeric keypad at the time of typing.

Everything that comes out of the DOM is mapped as string .

    
12.08.2017 / 00:56