input nubmer > maxlength 입력 후 자동 탭 이동 (핸드폰 번호 숫자 4자리 입력후 자동 탭넘김)
maxelngth 만큼 텍스트 입력 후 다음탭으로 focus 이동
```
<input type="text" id="input1" maxlength="4" >
<input type="text" id="input2" maxlength="4" >
`
$('#input1').on('keyup', function() {
if(this.value.length == 4) {
$('#input2').focus()
}
});
'DEV > javascript, jQuery' 카테고리의 다른 글
[javascript] underber to camel, camel to underbar (0) | 2020.10.28 |
---|---|
[jQuery] $(this).data('') : 원하는 데이터 값 사용 (0) | 2020.05.24 |
[javascript] input type=number maxlength 적용 (number 타입 maxlength) (0) | 2020.05.24 |
[javascript] 함수표현식과 함수선언식의 차이 (호이스팅) (0) | 2020.05.21 |
css와 js 위치, javascript 태그 위치 (0) | 2020.05.19 |