我只是想知道我们是否可以从javascript获取输入字段的最大长度
<input type="password" id="password" maxlength="20" >
我试过了,但返回未定义
console.log(document.getElementById("password").maxlength);
document.getElementById("password").maxLength
要使用Javascript访问它,您需要使用大写的“ L”
W3学校示例
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
点击生成二维码
我来说两句