1<input type="text" class="number" />
2
3<script>
4function degitOnly(e){
5 var unicode = e.charCode ? e.charCode : e.keyCode;
6 if (unicode!=8 && unicode!=9)
7 {
8 if (unicode<46||unicode>57||unicode==47)
9 return false
10 }
11}
12
13$(".number").inputFilter(function(value) {
14 return /^-?\d*$/.test(value);
15});
16</script>