ATM style decimal places
问题 I'm working on getting an old piece of code working, from 2003. I'm trying to replicate an ATM style decimal textbox. This code claims to have worked for someone, but I am having trouble implementing it. Maybe someone has a better way of achieving this? Maybe in jQuery? 回答1: This is how I would solve it: http://jsfiddle.net/77bMx/86/ Handles numpad input as well as standard number keys Works with backspace Will revert to 0.00 if you somehow manage to produce illegal input (like backspacing