<HTML>
<HEAD>
<TITLE> New Document </TITLE>
</HEAD>
<script>
//如一个文本框失去焦点时,判断输入的值只能为数字
function isNumber(){
isNum = /^[0-9]*$/;
alert(isNum.test(Form1.InputBox.value));
}
</script>
<BODY>
<FORM name="Form1" METHOD=POST ACTION="">
<INPUT TYPE="text" NAME="InputBox" value="" onblur="isNumber()">
</FORM>
</BODY>
</HTML>