<input type="text" id="d1" onblur=" chkNumber(this)"/>
<script type=”text/javascript” />
function chkNumber(eleText) {
var value =eleText.value;
var len =value.length;
for(vari=0;i<len;i++)
{
if(value.charAt(i)>"9"|| value.charAt(i)<"0")
{
alert("含有非数字字符");
eleText.focus();
break;
}
}
}
</script>