我正在使用 HTML5 input type=number
。它在 Chrome 浏览器中完美运行,但在 Firefox 和 IE9 中不起作用。
我想增加数量 one
即 step=1
并且我还设置 min=1
。
我正在使用以下代码:
<form action="" class="cart" method="post" enctype='multipart/form-data'>
<div class="quantity">
<input type="number" step="1" min="1" name="quantity" value="1" title="Qty" class="input-text qty text" />
</div>
<button type="submit" class="single_add_to_cart_button button alt">Add to cart</button>
</form>
是否有任何补丁或 hack 使其在 Firefox 和 IE9 中工作。否则,可能的解决方案是什么。
原文由 Mohit Bhansali 发布,翻译遵循 CC BY-SA 4.0 许可协议
注意:标记的 min 属性在 Internet Explorer 9 及更早版本或 Firefox 中不受支持。
注意:min 属性不适用于 Internet Explorer 10 中的日期和时间,因为 IE 10 不支持这些输入类型。
来源: http ://www.w3schools.com/tags/att_input_min.asp