- 정보공유
[퍼블리싱] 숫자형 input 요소 글자수 제한
function wz_maxLength_check(object) {
if (object.value.length > object.maxLength){
object.value = object.value.slice(0, object.maxLength);
}
}
<input type="number" name="" maxlength="4" oninput="wz_maxLength_check(this)">