Home  >  Article  >  Web Front-end  >  Decimal problem with input type=number

Decimal problem with input type=number

php中世界最好的语言
php中世界最好的语言Original
2018-03-14 09:22:473336browse

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.

Decimal problem with input type=number

# 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

Javascript’s observer pattern

Javascript proxy mode

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Set html to div in ReactNext article:Set html to div in React