maxlength="4" //4数字代表输入框只可以输入4位长度内容 <input type="text" maxlength="4" name="sss" value="" class="fm-txt" >