2 ms·
It is supported by all modern browsers. Even IE-11 supports valueAsNumber and the most important Constraint Validation API methods to deal with the problems the
by runarberg 4y ago
It is supported by all modern browsers. Even IE-11 supports valueAsNumber and the most important Constraint Validation API methods to deal with the problems the author mentions.
If you want to deal with inconsistent (and possible eccentric) user input: Use input.valueAsNumber
If you want to distinguish between empty and invalid inputs: Use input.validity.valid or input.validity.badInput
If you want to programmatically deal with incorrect entries: Again use the constraint validation API.