HTML
HTML5 表单属性
<input> 元素最小值与最大值设置
源代码:
点击运行 »
Enter a date before 1980-01-01: <input type="date" name="bday" max="1979-12-31"> Enter a date after 2000-01-01: <input type="date" name="bday" min="2000-01-02"> Quantity (between 1 and 5): <input type="number" name="quantity" min="1" max="5">
运行结果:
点击运行 »