I want a regex in JavaScript for validating decimal numbers.
It should allow only up to two decimal places. For example, it should allow 10.89 but not 10.899.
It should also allow only one period (.). For example, it should allow 10.89 but not 10.8.9.