I am trying to format a number input by the user into currency using javascript. This works fine on <input type="text" />
. However, on <input type="number" />
I cannot seem to be able to set the value to anything that contains non-numeric values. The following fiddle shows my problem
http://jsfiddle.net/2wEe6/72/
Is there anyway for me to set the value to something like $125.00
?
I want to use <input type="number" />
so mobile devices know to bring up a keyboard for number input.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…