This time I bring you the problem of decimals with input type=number. Using decimals with input type=numberWhat are the precautions?The following is a practical case, let's take a look.
type=number: Set the input input box to a numeric field with a spinner control
max number specifies the maximum allowed value.
min number specifies the minimum allowed value.
step number specifies the legal number interval (if step="3", the legal number is -3,0,3,6, and so on). If you need to enter a decimal, just set step=0.1 and keep it. The number of digits sets the minimum precision of the step.
value number specifies the default value.
As shown in the figure below: the input range is between 0.1-1, and the precision is 0.1.
# I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!
Recommended reading:
Using JS to implement sorting algorithms
How to use regular expressions in JS
Javascript’s singleton pattern
The above is the detailed content of Decimal problem with input type=number. For more information, please follow other related articles on the PHP Chinese website!