[공부용]참고 사이트 모음/[html]
[html] ip 주소 마스크 / input mask ip address
bled
2020. 11. 12. 19:53
<html>
<div>
<input type="text" maxlength="3" class="onlythree" />.
<input type="text" maxlength="3" class="onlythree" />.
<input type="text" maxlength="3" class="onlythree" />.
<input type="text" maxlength="3" class="onlythree" />
</div>
<javascript>
$(".onlythree").keyup(function () {
if (this.value.length == this.maxLength) {
$(this).next('.onlythree').focus();
}
});
<css>
.onlythree{
width: 50px;
border: 0;
}
div{
border: 1px solid gray;
display: inline-block;
}