<input value="0" onkeyup="if(event.keyCode==38) this.value++; else if(event.keyCode==40) this.value--; else this.value=parseInt(this.value);">