Aslan Kussein Asked:2020-08-12 14:29:34 +0800 CST2020-08-12 14:29:34 +0800 CST 2020-08-12 14:29:34 +0800 CST Firefox 和浮点数 772 大家好! 我遇到了这样一个问题:在 firefox 中<input type="number"/>它不想使用浮点数,但在 google chrome 中一切都很好。我能以某种方式解决这个问题吗? firefox 1 个回答 Voted Best Answer Qwertiy 2020-08-12T14:43:36+08:002020-08-12T14:43:36+08:00 一切正常。尝试使用分隔符(点或逗号)进行试验 - 这可能取决于区域设置。 document.querySelector('input').addEventListener('input', function () { document.querySelector('output').textContent = this.value }) <input type=number step=0.01 min=0 max=1> <output></output>
一切正常。尝试使用分隔符(点或逗号)进行试验 - 这可能取决于区域设置。