<html>
<head>
<title>判斷是否為數字及空格</title>
<script type="text/javascript" src="jquery
<script type="text/javascript">
function check_num() //建立函數
{
var Num=document
if(isNaN(Num) || Num=="" || Num
{
alert("請勿輸入非數字");
return false;
}else{
alert("正確");
}
}
</script>
</head>
<body>
請輸入數字
<input type="submit" value="提交" o~n~c~l~i~c~k~="check_num"> //這裡其實是onclick但是不讓寫
</body>
</html>
From:http://tw.wingwit.com/Article/program/Java/Javascript/201311/25498.html