<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>