<script language="javascript">
<!--
function checkNum() {
if(document.f.text1.value<=0 || document.f.text1.value>40) {
alert("40보다 작은 숫자를 입력해야 합니다.");
return;
}else{
document.f.text1.value.length = 2;
}
}
//-->
</script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
<form name="f">
<p><input type="text" name="text1" onkeyup="checkNum();"></p>
</form>