gpt4 book ai didi

HTML5 输入类型编号在 Firefox 中不起作用

转载 作者:太空狗 更新时间:2023-10-29 14:41:21 24 4
gpt4 key购买 nike

我正在使用 HTML5 input type=number。它在 Chrome 浏览器中完美运行,但在 Firefox 和 IE9 中不运行。

我想将数量增加 一个,即 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>

是否有任何补丁或黑客可以使其在 Firefox 和 IE9 中工作。或者,可能的解决方案是什么。

最佳答案

Firefox 或 Internet Explorer 不支持它,但版本 11 有部分支持。参见 this comparison matrix .

您可以使用 number polyfill shim 以获得对不受支持的浏览器的支持。

关于HTML5 输入类型编号在 Firefox 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17976393/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com