1,默認只能輸入整數html
<input type="number"/>
2,使用step屬性表示能夠接受的數值間隔(好比下面就容許輸入11.5)ide
<input type="number" step="0.1"/>
3,使用min和max屬性能夠限制數值的範圍htm
<input type="number" min="0" max="100"/>