Masked Input Plugin and regular expressions (for decimal numbers)
问题 I have a text input field in which I want to insert just numbers, then a comma, and then just two decimal digits. I'm trying to obtain this via jQuery, using Masked Input Plugin, but it seems not to work. This is what I have: <input type="text" name="cash" id="number"/> and <script type="text/javascript"> $.mask.definitions['p']='[0-9]+'; $.mask.definitions['d']='[0-9]{2}'; $("#number").mask("p,d"); <script> But the result is a mask with just one digit, then a comma, and then something I'm