SMALL
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript">
function maxLengthCheck(object){
if (object.value.length > object.maxLength){
object.value = object.value.slice(0, object.maxLength);
}
}
</script>
<input type="number" maxlength="4" oninput="maxLengthCheck(this)"/>
출처 : http://milkye.tistory.com/265
LIST
'Jquery' 카테고리의 다른 글
AmCharts에서 마우스 오버시 범례에 그래프 값 안나오게하기 (0) | 2018.12.12 |
---|---|
jsp autocomplete, 자동완성 제한 (0) | 2018.12.06 |
alert 확인/취소 창 띠우기 (0) | 2018.11.27 |
checkbox 모두 체크하기 , 모두 해제하기(모두 체크하기 / 모두해제) (0) | 2018.11.23 |
Jquery removeClass 단일,여러개 클래스 삭제 (0) | 2018.11.05 |