听起来微不足道,但它对我不起作用......我试图设置NUMBER输入的最大长度,但它不起作用。感谢您的帮助。这是我的代码。两者都不适用于 Chrome
<input id="demo02" type="number">
$(document).ready(function(){
$("#demo02").attr('maxlength','2');
});
$(document).ready(function(){
$("#demo02").prop('maxlength','2');
});
Run Code Online (Sandbox Code Playgroud)