더 나은 프로그래머가 되자

모바일에서 숫자키패드 사용 input type number 본문

레이아웃/HTML

모바일에서 숫자키패드 사용 input type number

greathuman 2017. 1. 26. 10:01

<script>
function maxLengthCheck(object){
	if (object.value.length > object.maxLength){
		object.value = object.value.slice(0, object.maxLength);
	}
}
</script>
<input type="number" name="tel1" pattern="[0-9]*" inputmode="numeric" maxlength="3" oninput="maxLengthCheck(this)"/>
Comments