<html>
<head>
<script>
function on_check_input()
{
inputDemo = document.getElementById( "input_demo");
inputStr = inputDemo.value;
if((inputStr == "") || isNaN(inputStr))
{
alert( "不是数字");
}
else
{
alert( "是数字");
}
}
</script>
<title>
This is a test web page
</title>
</head>
<body>
<p>
<input id="input_demo" type="text">
</p>
<p>
<Button type="button" onClick="on_check_input()">Click Me</button>
</p>
</body>
</html>