只能输入数字的INPUT
1 window.onload = function() {
2 var content = document.getElementById("content");
3
4 content.onkeypress = function(ev) {
5 var oEvent = ev || event;
6
7 //keyCode
8 //'0':48;
9 //'9':57;
10 if (oEvent.keyCode < 48 || oEvent.keyCode > 57) {
11 return false;
12 }
13 };
14 };