HTML5 is a great leap forward, one of the many improvements is form control. When you wanted to allow only numbers with decimals you had to rely on jQuery or another tool. You couldn't use type="number" because it only allowed for whole numbers. Try it below!

But now it's easy to allow decimals with the step="any" attribute to allow decimals. No longer do you need JavaScript!

The number input looks like this:

<input type="number" step="any">