js校验文本框中只能输入0~9的数字
<input type=text ōnpaste="return false" ōnkeypress="a()">数字<br>
<scrīpt language=javascrīpt>
function a()
{
var k = window.event.keyCode;
if (k < 48 || k > 57){
alert("你输入的不是数字!")
window.event.keyCode = 0 ;}
}
</scrīpt>
<scrīpt language=javascrīpt>
function a()
{
var k = window.event.keyCode;
if (k < 48 || k > 57){
alert("你输入的不是数字!")
window.event.keyCode = 0 ;}
}
</scrīpt>