When input[type=”number”], how to get the value of 12. in this case?

  node.js, question

http://jsbin.com/yehusaposu/e …

  • First, because I need to use the numeric keypad on the mobile side, I must use input[type=”number”]

  • Second, because WeChat does not support keyup, keydown, keyup keycode in keyup event objects, there is no solution.

I need to get the string in input every time the input event occurs, then push it into the array, and then talk about the string in the array.
String and regular proofreading, proofreading does not pass will pop off the end of the array, and then remove the Input characters in input, but due to 12. in this case I get a 12, also can’t know when the user input decimal point, and a few decimal points, can’t with regular proofreading, what is the solution?

I think you know your need is to proofread What?. Are decimal points allowed or not?

First, js sets the pattern attribute of input to “[0-9]*”, which does not require type=number. thus, it can be a numeric keyboard and can normally monitor any input value.
Second: Simulate a numeric keyboard without using a system keyboard