<input type="number" oninput="checkTextLength( this , 5)">
function checkTextLength(obj, length) {
if(obj.value.length > length) {
obj.value = obj.value.substr(0, length);
}
}
时间: 2024-10-13 06:22:40