input 에 자연수 및 정수만 입력

자연수만 입력

<script>
function myint(numint){
if(numint.value-parseInt(numint.value)!='0'||numint.value<0) numint.value='';
}
</script>

<input onmouseout=myint(this)>

-----

정수만 입력

<script>
function myint(numint){
if(numint.value-parseInt(numint.value)!='0') numint.value='';
}
</script>

<input onmouseout=myint(this)><div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 16:57:14 JavaScript에서 이동 됨]</div>
|

댓글 1개

정수만 입력 받기에는 이게 더 편할꺼 같은데요 ^^
onkeyPress="if ((event.keyCode<48) || (event.keyCode>57)) event.returnValue=false;"style="ime-mode:disabled"
댓글을 작성하시려면 로그인이 필요합니다.

팁게시판

디자인과 관련된 유용한 정보를 공유하세요. 질문은 상단의 QA에서 해주시기 바랍니다.

+
제목 글쓴이 날짜 조회
14년 전 조회 2,737
14년 전 조회 1,209
14년 전 조회 805
14년 전 조회 1,220
14년 전 조회 648
14년 전 조회 920
14년 전 조회 1,574
14년 전 조회 1,021
14년 전 조회 1,245
14년 전 조회 937
14년 전 조회 1,636
14년 전 조회 1,225
14년 전 조회 1,382
14년 전 조회 827
14년 전 조회 840
14년 전 조회 1,401
14년 전 조회 2,325
14년 전 조회 2,231
14년 전 조회 1,861
14년 전 조회 1,253
14년 전 조회 1,525
14년 전 조회 1,270
14년 전 조회 1,965
14년 전 조회 735
14년 전 조회 2,533