[英]How do you make it so when an Input has a value under 4, it will make a text go up and make them do it over 4?
我正在創建一個“注冊頁面”,所以我想這樣做,如果密碼少於4個字符,它將告訴他們密碼必須為4個或以上字符。
我試着尋找這個,沒有答案。 我已經嘗試了多個網站。
<input type="password" id="name" name="name" required minlength="4" maxlength="8" size="10">
我希望在測試最小值為4和最大值為8時,但是當我在輸入中輸入值3時,沒有任何消息。
您的輸入內容必須存在於<form>
標記內:
<form> <input type="password" id="name" name="name" required minlength="4" maxlength="8" size="10"> </form>
在上面的示例中,輸入少於四個字符,然后在字段中按Enter鍵,您將看到瀏覽器的內置消息。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.