簡體   English   中英

“ maxlength”不適用於html文本框中的input type =“ number”

[英]“maxlength” is not working with input type=“number” in html textbox

Maxlength不適用於type =“ number”

number輸入沒有maxlength屬性。

而是有maxmin屬性。

該HTML將提供最大長度為3的數字:

 <input type="number" min="0" max="999"/> 

請注意,仍然可以手動輸入更大的數字。

嘗試這個

<input type="number" max="100"/>

你應該改用這個

<input type="number" name="MyInteger" min="1" max="99">

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM