2014-12-13 92 views
-2

我必須設置輸入數量限制的限制,以便用戶只能輸入3個數字。 這裏我輸入標籤:設置輸入類型數量限制

  <input type="number" name="age" id="age" class="inPadd" maxlength="3"> 
+0

有什麼問題嗎? – 2014-12-13 08:27:20

+0

[How to add maxlength for HTML5 input type =「number」element?](http://stackoverflow.com/questions/8354975/how-to-add-maxlength-for-html5-input-type-number -element) – JJJ 2014-12-13 08:29:07

+0

@Juhana用戶只能輸入3個年齡段的數字。 – 2014-12-13 08:42:43

回答

0

您應該使用屬性min="0"max="999"代替maxlength

<input type="number" name="age" id="age" class="inPadd" min="0" max="999"> 
+0

它不工作 – 2014-12-13 08:36:22

相關問題