根据http://simon.html5.org/html-elements,“数字”输入类型的“值属性,如果指定,而不是空的,必须有一个有效的浮点数的值。
然而,简单地说(在Chrome.latest中,无论如何),使用整数而不是浮点数的“updown”控件:
body { background-color: lightyellow;}header { font-family:'Segoe UI', 'Segoe Light', 'Courier New', sans-serif; //font-weight: bold; padding-left: 15px; background-color: Blue; color: White;}label { font-family: Consolas, 'Segoe UI', sans-serif; margin-left: 10px; min-width: 120px;}input { float:right;}.clearBoth { clear:both;}<header>New Delivery - @SerialNumber</header></br><label>Invoice #</label><input type="text" id="invoiceNumber"></input><div class="clearBoth"></div><label>Date</label><input type="date" id="date"></input><div class="clearBoth"></div><label>Total Amt $</label><input type="number" id="totalAmt"></input>运行代码片段Hide results展开代码段
有一个浮点输入元素原生的HTML5,或使数字输入类型的工作与浮动,而不是整数?或者我必须诉诸于jQuery UI插件?
相似问题