2019独角兽企业重金招聘Python工程师标准>>> 通常都是 用js var a=$("#id").val(); a.length 这样判断 其实在输入框中加入 maxLen="20"; 转载于:https://my.oschina.net/u/2299924/blog/3036065