HTML input type=“number” still returning a string when accessed from javascript

后端 未结 7 976
抹茶落季
抹茶落季 2020-11-29 08:18

I\'m new to javascript , I\'m trying learning how functions etc in JS and trying to add 2 numbers

相关标签:
7条回答
  • 2020-11-29 08:48

    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.

    0 讨论(0)
提交回复
热议问题