SyntaxFix
Write A Post
Hire A Developer
Questions
Try this:
document.getElementById(target).value = newVal.replace(/^\d+(\.\d{0,2})?$/, "");